Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

wip move recipes to use python build scripts #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bitfurnace/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
context:
name: bitfurnace
version: 0.1.1

package:
name: '{{ name|lower }}'
version: '{{ version }}'

source:
git_url: file:///Users/wolfvollprecht/Programs/bitfurnace
git_rev: main


build:
number: 0
noarch: true
script:
- cp -r bitfurnace $PREFIX

50 changes: 50 additions & 0 deletions bzip2/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from make import Make

import shutil
import glob
from pathlib import Path

def install(from_path, to_path, follow_symlinks=False):
fp = str(from_path)
tp = str(to_path)

to_path.mkdir(parents=True, exist_ok=True)

if '*' in fp:
for f in glob.glob(fp):
shutil.copy(f, tp, follow_symlinks=follow_symlinks)
else:
shutil.copy(fp, tp, follow_symlinks=follow_symlinks)

class UnixRecipe(Make):

def get_install_args(self):
return self.default_install_args + self.install_args

def install(self):
run(['make', 'install'] + self.get_install_args())
if not features.static:
if target_platform.startswith('linux'):
run(['make', '-f', 'Makefile-libbz2_so'] + self.get_install_args())
install(f'libbz2.so.{pkg_version}', prefix / 'lib')
Path(prefix / 'lib' / 'libbz2.so').symlink_to(prefix / 'lib' / f'libbz2.so.{pkg_version}')
else:
run([cc] + f'-shared -Wl,-install_name -Wl,libbz2.dylib -o libbz2.{pkg_version}.dylib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o'.split())

install(f'libbz2.{pkg_version}.dylib', prefix / 'lib')
Path(prefix / 'lib' / 'libbz2.dylib').symlink_to(prefix / 'lib' / f'libbz2.{pkg_version}.dylib')

Path(prefix / 'lib' / 'libbz2.a').unlink()

def __init__(self):
self.cflags += ['-Wall', '-Winline', '-O2', '-g', '-D_FILE_OFFSET_BITS=64', '-fPIC']

cflags = ' '.join(self.cflags)
self.build_args = [f'CFLAGS={cflags}']
self.install_args = [f'CFLAGS={cflags}']


if target_platform.startswith('win'):
pass
else:
Recipe = UnixRecipe
24 changes: 0 additions & 24 deletions bzip2/build.sh

This file was deleted.

1 change: 1 addition & 0 deletions bzip2/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build:
requirements:
build:
- '{{ compiler("c") }}'
- bitfurnace
# - sel(win): jom
- sel(win): cmake
- sel(win): ninja
Expand Down
2 changes: 1 addition & 1 deletion conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ MACOSX_DEPLOYMENT_TARGET: # [osx]
- 11.0 # [osx and arm64]
- 10.9 # [osx and x86_64]
CONDA_BUILD_SYSROOT:
- /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk # [osx and arm64]
- /opt/MacOSX11.0.sdk # [osx and arm64]
39 changes: 39 additions & 0 deletions libarchive/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from bitfurnace.autotools import Autotools

class Recipe(Autotools):

def get_configure_args(self):
configure_args = []

if features.static:
configure_args += ['--enable-static', '--disable-shared']
else:
configure_args += ['--disable-static', '--enable-shared']

def add_feature(feat, opt):
if feat:
configure_args.append(f'--with-{opt}')
else:
configure_args.append(f'--without-{opt}')

if target_platform.startswith('osx'):
configure_args += ['--with-iconv']
else:
configure_args += ['--without-iconv']
if features.zstd:
self.ldflags += ['-pthread']

add_feature(features.bzip2, 'bz2lib')
add_feature(features.lz4, 'lz4')
add_feature(features.xz, 'lzma')
add_feature(features.lzo, 'lzo2')
add_feature(features.zstd, 'zstd')
add_feature(features.openssl, 'openssl')

configure_args += [
'--without-cng',
'--without-nettle',
'--without-expat',
]

return configure_args
36 changes: 0 additions & 36 deletions libarchive/build.sh

This file was deleted.

37 changes: 19 additions & 18 deletions libarchive/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ build:
requirements:
build:
- '{{ compiler("c") }}'
- bitfurnace
# Does not work in this recips at present
# we manually convert C99 to C89 instead.
# - c99-to-c89 # [win and vc<14]
Expand All @@ -45,74 +46,74 @@ requirements:
- sel(win): m2-patch
host:
- sel(win and vc<14): msinttypes
- sel(osx): libiconv-static
- sel(osx): libiconv
run:
- sel(osx): libiconv-static
- sel(osx): libiconv

features:
- name: zlib
default: true
requirements:
host:
- zlib-static
- zlib
run:
- zlib-static
- zlib

- name: zstd
default: true
requirements:
host:
- zstd-static
- zstd
run:
- zstd-static
- zstd

- name: openssl
default: true
requirements:
host:
- openssl-static
- openssl
run:
- openssl-static
- openssl

- name: lzo
default: true
requirements:
host:
- lzo-static
- lzo
run:
- lzo-static
- lzo

- name: xz
default: true
requirements:
host:
- xz-static
- xz
run:
- xz-static
- xz

- name: bzip2
default: true
requirements:
host:
- bzip2-static
- bzip2
run:
- bzip2-static
- bzip2

- name: lz4
default: true
requirements:
host:
- lz4-c-static
- lz4-c
run:
- lz4-c-static
- lz4-c

- name: xml2
default: true
requirements:
host:
- libxml2-static
- libxml2
run:
- libxml2-static
- libxml2

- name: static
default: false
Expand Down
31 changes: 1 addition & 30 deletions libssh2/build.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,2 @@
#!/bin/bash
from cmake import CMake

# copy files which are missing from the release tarball
# see: https://github.com/libssh2/libssh2/issues/379
# TODO: remove this in the 1.9.1 or later releases
cp ${RECIPE_DIR}/missing_files/*.c tests/

# We use a repackaged cmake from elsewhere to break a build cycle.
export PATH=${PREFIX}/cmake-bin/bin:${PATH}

mkdir build && cd build

if [[ "${FEATURE_STATIC}" == "1" ]]; then
BUILD_TYPE="-D BUILD_SHARED_LIBS=OFF"
else
BUILD_TYPE="-D BUILD_SHARED_LIBS=ON"
fi

cmake ${CMAKE_ARGS} \
-D CMAKE_INSTALL_PREFIX=$PREFIX \
-D CMAKE_PREFIX_PATH=$PREFIX \
$BUILD_TYPE \
-D CRYPTO_BACKEND=OpenSSL \
-D CMAKE_INSTALL_LIBDIR=lib \
-D ENABLE_ZLIB_COMPRESSION=ON \
-D CMAKE_INSTALL_RPATH=$PREFIX/lib \
$SRC_DIR

make -j${CPU_COUNT}
# ctest # fails on the docker image
make install
14 changes: 6 additions & 8 deletions libssh2/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ requirements:
build:
# This breals a dependency cycle:
# curl->libssh2->cmake->curl
- '{{ compiler("c") }}'
- sel(win): cmake-binary
- sel(not win): cmake-no-system
- sel(not (osx and arm64)): '{{ compiler("c") }}'
- sel(osx and arm64): '{{ compiler("clang_bootstrap") }}'
- sel(win): ninja
- sel(unix): make
- ninja
host:
- openssl-static
- zlib-static
- openssl
- zlib
run:
- openssl-static
- zlib-static
- openssl
- zlib

# test:
# commands:
Expand Down
6 changes: 6 additions & 0 deletions reproc/build_c.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from cmake import CMake

class Recipe(CMake):
cmake_configure_args = {
'BUILD_SHARED_LIBS': not features.static
}
14 changes: 0 additions & 14 deletions reproc/build_c.sh

This file was deleted.

11 changes: 11 additions & 0 deletions reproc/build_cpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from cmake import CMake

class Recipe(CMake):
cmake_configure_args = {
'BUILD_SHARED_LIBS': not features.static,
'REPROC++': True
}

def pre_configure(self):
if (self.workdir / "CMakeCache.txt").exists():
(self.workdir / "CMakeCache.txt").unlink()
Loading