├── CONTRIBUTING.md ├── README.md ├── TIPS.md ├── bootstrap.sh ├── community ├── autoconf.hpkg ├── automake.hpkg ├── bash.hpkg ├── bc.hpkg ├── bison.hpkg ├── busybox.hpkg ├── bzip2.hpkg ├── capstone.hpkg ├── cmake.hpkg ├── cpio.hpkg ├── cproc.hpkg ├── dosfstools.hpkg ├── ed.hpkg ├── file.hpkg ├── flex.hpkg ├── fspec-tools.hpkg ├── gettext.hpkg ├── go.hpkg ├── janet.hpkg ├── less.hpkg ├── libarchive.hpkg ├── libbsd.hpkg ├── libedit.hpkg ├── libevent.hpkg ├── libffi.hpkg ├── libsodium.hpkg ├── libtool.hpkg ├── libuv.hpkg ├── libzip.hpkg ├── llvmorg.hpkg ├── luajit.hpkg ├── luarocks.hpkg ├── lz4.hpkg ├── lzip.hpkg ├── m4.hpkg ├── mcpp.hpkg ├── meson.hpkg ├── mrsh.hpkg ├── mtools.hpkg ├── nano.hpkg ├── nasm.hpkg ├── ncurses.hpkg ├── nginx.hpkg ├── ninja.hpkg ├── node.hpkg ├── nomad.hpkg ├── openssl.hpkg ├── patchelf.hpkg ├── pcre.hpkg ├── pcre2.hpkg ├── peg.hpkg ├── perl.hpkg ├── proot.hpkg ├── python3.hpkg ├── quickjs.hpkg ├── radare2.hpkg ├── re2c.hpkg ├── readline.hpkg ├── rlwrap.hpkg ├── rust.hpkg ├── rwpart.hpkg ├── samurai.hpkg ├── scdoc.hpkg ├── sqlite3.hpkg ├── squashfs-tools.hpkg ├── syslinux.hpkg ├── talloc.hpkg ├── texinfo.hpkg ├── tmux.hpkg ├── upx.hpkg ├── uthash.hpkg ├── util-linux.hpkg ├── vim.hpkg ├── xxhash.hpkg ├── xz.hpkg ├── yasm.hpkg ├── zig.hpkg └── zlib.hpkg ├── core.hpkg ├── prelude.hpkg ├── seed-out.hpkg └── seed.hpkg /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # So, you want to contribute `hpkg`s? 2 | 3 | Great! The more, the merrier. However, there are some things that are good to 4 | keep in mind. 5 | 6 | ## As lean as possible 7 | 8 | Generally, the fewer dependencies an `hpkg` has, the better. That is, a package 9 | should not import more packages than just enough. This poses the question, 10 | though; how should we handle configurable dependecies? For example `nginx` needs 11 | the `pcre` package for URL-rewrite functionality. In such cases, until the need 12 | arises to do otherwise, you can err on the side of default, so import the 13 | packages needed for the default configuration. When it becomes necessary to 14 | repackage an existing `hpkg` in another configuration, the existing can be copied 15 | and suffixed appropriately for easy identification. 16 | 17 | ## New packages are added via PRs 18 | 19 | If you have an `hpkg` you would like to add, please open a PR with, at least, 20 | either "Add" or "Update" and then the package's name in the title. If it is an 21 | Update, then it is required to add in the description _why_ the package is 22 | updated. Otherwise, the description is optional. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hpkgs 2 | 3 | A package repository for [hermes](https://github.com/andrewchambers/hermes). 4 | 5 | This repository is self hosting and totally hermetic. 6 | 7 | # The Binary Seed 8 | 9 | ```seed.hpkg``` contains the definitions of the binary seed package, 10 | all other packages are derived from this binary seed. 11 | 12 | Hermes uses this binary seed to avoid depending on any 13 | software installed on your system. 14 | 15 | This binary seed itself contains a statically linked busybox and musl-gcc 16 | which is enough to bootstrap all the other software. 17 | 18 | ## Regenerating your own seed 19 | 20 | ### Bootstrapping 21 | To regenerate your own bootstrap binary seed from another linux distro you can use bootstrap.sh. 22 | 23 | ### Using hermes 24 | 25 | The binary seed can build itself with exact an exact output hash 26 | when hermes is installed in multi user mode. 27 | 28 | To do so simply run: 29 | 30 | ```hermes build seed-out.hpkg``` 31 | 32 | The hash of this file should match the hash of the input seed, meaning you 33 | have a self hosted software environment with access to all source code. 34 | 35 | -------------------------------------------------------------------------------- /TIPS.md: -------------------------------------------------------------------------------- 1 | # Tips and tricks 2 | 3 | Building packages from source can be quite tricky, and here are some tips and 4 | tricks you can use when writing `hpkg`s. 5 | 6 | ### Build it manually first 7 | 8 | It can be tempting to jump right in, but if you don't spend up front time learning how to 9 | build the software manually, you might have some pain. 10 | 11 | For difficult packages, consider investing in a 'shell' package, 12 | which just contains a way to run commands with env vars set for you to test with. 13 | This should help you manually test things with a fast iteration time. 14 | 15 | In the future hpkgs may come with helper functions or a repl for helping you do this. 16 | 17 | ### Determine what the package's build system(s) is/are 18 | 19 | * It might contain configurations for script-generating systems, for example, 20 | GNU Autotools (autoconf/configure). 21 | * Some sources include a simple Makefile with a custom build process. 22 | * Other sources contain configurations for use with meta-build systems, like 23 | CMake, that can output build-direcives for several build systems. 24 | * Some are defined as programs, like Janet-projects for example. 25 | * yet others, probably. 26 | 27 | The build process/system/configuration can give lot of hints with regards to 28 | which _dependencies_ are required. 29 | 30 | ### There are many existing package-repositories 31 | 32 | To name a few, generally, high-quality sources of inspiration: 33 | 34 | * [FreeBSD Ports](https://www.freebsd.org/ports/) [Index](https://www.freshports.org/) 35 | * [Arch Linux](https://wiki.archlinux.org/index.php/Official_repositories) 36 | * [Arch Linux AUR](https://aur.archlinux.org/) 37 | * [Alpine Linux](https://pkgs.alpinelinux.org/packages) 38 | * [NixOS](https://nixos.org/nixos/packages.html) 39 | * [Guix](https://guix.gnu.org/packages/) 40 | 41 | Etc. etc. 42 | 43 | ### There might be several source archives for the same release of a package 44 | 45 | And it might be the case that one of the archives contains build configuration 46 | whereas the others do not, so it might be worth it to download each `*.tar.gz` 47 | and compare whether one or the other has or has not included the build 48 | configuration. 49 | 50 | ### When the build fails. Diagnostics! 51 | 52 | #### Logging output 53 | 54 | `strace` can be helpful sometimes in diagnosing issues. 55 | 56 | For example, you can try the following: 57 | 58 | ```sh 59 | sudo strace -f \ 60 | -u $USER \ 61 | -o pkgname.trace \ 62 | -- hermes build -m pkgname.hpkg -e pkgname 2> pkgname.log 63 | ``` 64 | 65 | `-f` is for tracing child processes 66 | `-u` specifies the user to run the command as 67 | `-o` writes the trace output to a file, `pkgname.trace` 68 | 69 | Then you can look for (sometimes substrings of) received error messages within 70 | the resulting `pkgname.trace`. 71 | 72 | Note that the `trace` files often contain a lot of information. (`grep` or `rg` 73 | is useful for searching throught them) 74 | 75 | `pkgname.log` can sometimes be helpful to look through as well. 76 | 77 | #### Debugging the `hpkg` 78 | 79 | In multi user mode, we typically don't get interactive access to files and 80 | directories, but to diagnose problems we need to check output of commands or 81 | check log files etc. 82 | 83 | We can get REPL access by doing something like the following: 84 | 85 | 1. edit the .hpkg file to contain an invocation of: 86 | 87 | `(repl nil nil (fiber/getenv (fiber/current)))` 88 | 89 | within the relevant builder function, say after a form that's an invocation of 90 | configure (e.g. `(sh/$ ./configure ...)`) 91 | 92 | 2. invoke the hermes build as follows: 93 | 94 | `hermes build -m pkgname.hpkg --debug` 95 | 96 | the result should be a REPL at which one may evaluate janet forms. To get access 97 | to a shell, you can try: 98 | 99 | `(os/execute ["/bin/sh"])` 100 | 101 | N.B. in this case `/bin/sh` would need to be in the `PATH` of the environment. 102 | 103 | Note: using `rlwrap` makes the REPl interaction nicer, e.g. 104 | `rlwrap hermes build -m pkgname.hpkg --debug` 105 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | set -eux 2 | 3 | dl () { 4 | if ! test -f $1 5 | then 6 | wget $2 -O $1.tmp 7 | mv $1.tmp $1 8 | fi 9 | } 10 | 11 | dl busybox.tar.bz2 \ 12 | https://busybox.net/downloads/busybox-1.31.1.tar.bz2 13 | dl musl-cross-make.tar.gz \ 14 | https://github.com/richfelker/musl-cross-make/tarball/5086175f29021e3bebb7d9f5d83c4a796d96ebbd 15 | 16 | cat <<-EOF > mcm-stage1-config.mak 17 | TARGET = x86_64-linux-musl 18 | LINUX_VER = 4.19.90 19 | COMMON_CONFIG += --enable-new-dtags --disable-nls CFLAGS=-O3 CXXFLAGS=-O3 LDFLAGS=-s 20 | GCC_CONFIG += --disable-libquadmath --disable-decimal-float 21 | GCC_CONFIG += --disable-libitm 22 | GCC_CONFIG += --disable-fixed-point 23 | GCC_CONFIG += --disable-lto --disable-bootstrap 24 | EOF 25 | 26 | cat <<-EOF > mcm-stage2-config.mak 27 | TARGET = x86_64-linux-musl 28 | LINUX_VER = 4.19.90 29 | COMMON_CONFIG += --enable-new-dtags --disable-nls CFLAGS=-O3 CXXFLAGS=-O3 LDFLAGS=-s 30 | COMMON_CONFIG += CC="x86_64-linux-musl-gcc -static --static" CXX="x86_64-linux-musl-g++ -static --static" 31 | GCC_CONFIG += --disable-libquadmath --disable-decimal-float 32 | GCC_CONFIG += --disable-libitm 33 | GCC_CONFIG += --disable-fixed-point 34 | GCC_CONFIG += --disable-lto 35 | EOF 36 | 37 | mcm_stage() { 38 | stage=$1 39 | if ! test -d mcm${stage}_out 40 | then 41 | rm -rf mcm${stage} mcm${stage}_out.tmp 42 | mkdir mcm${stage} mcm${stage}_out.tmp 43 | mcm_out_tmp="$(pwd)/mcm${stage}_out.tmp" 44 | cd mcm${stage} 45 | tar --strip-components 1 -zxf ../musl-cross-make.tar.gz 46 | cp ../mcm-stage${stage}-config.mak ./config.mak 47 | make extract_all 48 | make -j $(nproc) 49 | make install "OUTPUT=$mcm_out_tmp" 50 | cd .. 51 | mv mcm${stage}_out.tmp mcm${stage}_out 52 | fi 53 | } 54 | 55 | ORIG_PATH="$PATH" 56 | mcm_stage 1 57 | export PATH="$(pwd)/mcm1_out/bin:$PATH" 58 | mcm_stage 2 59 | export PATH="$(pwd)/mcm2_out/bin:$ORIG_PATH" 60 | 61 | if ! test -d busybox 62 | then 63 | rm -rf busybox.tmp 64 | mkdir busybox.tmp 65 | cd busybox.tmp 66 | tar --strip-components 1 -jxf ../busybox.tar.bz2 67 | make CC=x86_64-linux-musl-gcc LDFLAGS=-static defconfig 68 | make CC=x86_64-linux-musl-gcc LDFLAGS=-static -j $(nproc) 69 | cd .. 70 | mv busybox.tmp busybox 71 | fi 72 | 73 | if ! test -d seedfs 74 | then 75 | rm -rf seedfs.tmp 76 | mkdir seedfs.tmp 77 | cd seedfs.tmp 78 | cp -r ../mcm2_out/* ./ 79 | cp ../busybox/busybox ./bin/ 80 | cd bin 81 | for app in $(./busybox --list) 82 | do 83 | ln -s ./busybox $app 84 | done 85 | ln -s ./x86_64-linux-musl-ar ar 86 | ln -s ./x86_64-linux-musl-as as 87 | ln -s ./x86_64-linux-musl-c++ c++ 88 | ln -s ./x86_64-linux-musl-c++ g++ 89 | ln -s ./x86_64-linux-musl-cpp cpp 90 | ln -s ./x86_64-linux-musl-gcc cc 91 | ln -s ./x86_64-linux-musl-gcc gcc 92 | ln -s ./x86_64-linux-musl-ld ld 93 | ln -s ./x86_64-linux-musl-nm nm 94 | ln -s ./x86_64-linux-musl-objcopy objcopy 95 | ln -s ./x86_64-linux-musl-objdump objdump 96 | ln -s ./x86_64-linux-musl-ranlib ranlib 97 | ln -s ./x86_64-linux-musl-readelf readelf 98 | ln -s ./x86_64-linux-musl-strings strings 99 | ln -s ./x86_64-linux-musl-strip strip 100 | cd ../../ 101 | mv seedfs.tmp seedfs 102 | fi 103 | 104 | cd seedfs 105 | find . \ 106 | | LC_ALL=C sort \ 107 | | tar --owner=root:0 --group=root:0 --mtime='UTC 2019-01-01' --no-recursion -T - -cf - \ 108 | | gzip -9 > ../seed.tar.gz 109 | -------------------------------------------------------------------------------- /community/autoconf.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./m4) 4 | (use ./perl) 5 | 6 | (defsrc autoconf-src 7 | :url 8 | "https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz" 9 | :hash 10 | "sha256:64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684") 11 | 12 | (defpkg autoconf 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk core/coreutils core/grep m4 18 | core/make perl core/sed])) 19 | (os/setenv "CFLAGS" *default-cflags*) 20 | (os/setenv "LDFLAGS" *default-ldflags*) 21 | (unpack-src autoconf-src) 22 | (core/link-/bin/sh) 23 | (sh/$ ./configure 24 | --prefix= ^ (dyn :pkg-out)) 25 | (sh/$ make -j (dyn :parallelism)) 26 | (sh/$ make install))) 27 | -------------------------------------------------------------------------------- /community/automake.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./autoconf) 4 | (use ./m4) 5 | (use ./perl) 6 | 7 | (defsrc automake-src 8 | :url 9 | "https://ftp.gnu.org/gnu/automake/automake-1.16.tar.gz" 10 | :hash 11 | "sha256:80da43bb5665596ee389e6d8b64b4f122ea4b92a685b1dbd813cd1f0e0c2d83f") 12 | 13 | (defpkg automake 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (join-pkg-paths ":" "/bin" 18 | [autoconf core/awk core/coreutils core/dash 19 | core/findutils core/gcc core/grep m4 20 | core/make perl core/sed])) 21 | (os/setenv "CFLAGS" *default-cflags*) 22 | (os/setenv "LDFLAGS" *default-ldflags*) 23 | (unpack-src automake-src) 24 | (core/link-/bin/sh) 25 | (sh/$ ./configure 26 | --prefix= ^ (dyn :pkg-out)) 27 | (sh/$ make -j (dyn :parallelism)) 28 | (sh/$ make install))) 29 | -------------------------------------------------------------------------------- /community/bash.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc bash-src 5 | :url "https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz" 6 | :hash "sha256:b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d") 7 | 8 | (defpkg bash 9 | :builder 10 | (fn [] 11 | (core/link-/bin/sh) 12 | (os/setenv "PATH" (pkg-path "/bin" core/build-env)) 13 | (unpack-src bash-src) 14 | (sh/$ ./configure --without-bash-malloc "--prefix=" ^ (dyn :pkg-out)) 15 | (sh/$ make -j (dyn :parallelism)) 16 | (sh/$ make install))) 17 | -------------------------------------------------------------------------------- /community/bc.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | # NOTE This is not the gnu bc, if we run into issues we can package that and rename this one. 5 | (defsrc bc-src 6 | :url "https://git.yzena.com/attachments/3c9efffe-bbc5-469a-9287-7f258783cc1e" 7 | :hash "sha256:c017a6c0482cf7c4a2b31dae1f406028017a5e939d98dd6c78aa94ce3ecc8d38") 8 | 9 | (defpkg bc 10 | :builder 11 | (fn [] 12 | (core/link-/bin/sh) 13 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [core/coreutils core/gcc core/sed core/findutils core/make])) 14 | (os/setenv "CC" "gcc") 15 | (os/setenv "CFLAGS" *default-cflags*) 16 | (os/setenv "LDFLAGS" *default-ldflags*) 17 | (unpack-src bc-src) 18 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 19 | (sh/$ make -j (dyn :parallelism)) 20 | (sh/$ make install))) 21 | -------------------------------------------------------------------------------- /community/bison.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./m4) 4 | 5 | (defsrc bison-src 6 | :url 7 | "https://ftp.gnu.org/gnu/bison/bison-3.6.tar.xz" 8 | :hash 9 | "sha256:e16f26baa2ebff141333e452c3cc5d8ea26bda6d2cd8b0b7a5604faa3a4ad47b") 10 | 11 | (defpkg bison 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/coreutils core/gcc core/sed core/diffutils core/grep core/awk core/make 17 | m4])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 20 | (unpack-src bison-src) 21 | (core/link-/bin/sh) 22 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /community/busybox.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc busybox-src 5 | :url 6 | "https://busybox.net/downloads/busybox-1.31.1.tar.bz2" 7 | :hash 8 | "sha256:d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998") 9 | 10 | (defpkg busybox 11 | :builder 12 | (fn [] 13 | (core/link-/bin/sh) 14 | (os/setenv "PATH" (pkg-path "/bin" core/build-env)) 15 | (os/setenv "KCONFIG_NOTIMESTAMP" "1") 16 | (def out-bin-dir (string (dyn :pkg-out) "/bin")) 17 | (def make-args ["HOSTCC=gcc --static" 18 | "LDFLAGS=--static" 19 | (string "CFLAGS=" *default-cflags*)]) 20 | (os/mkdir out-bin-dir) 21 | (unpack-src busybox-src) 22 | (sh/$ make ;make-args defconfig) 23 | (sh/$ make ;make-args -j (dyn :parallelism) busybox) 24 | (sh/$ cp ./busybox ,out-bin-dir) 25 | (os/cd out-bin-dir) 26 | (each app (string/split "\n" (sh/$<_ ./busybox --list)) 27 | (os/symlink "./busybox" app)))) 28 | -------------------------------------------------------------------------------- /community/bzip2.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc bzip2-src 5 | :url 6 | "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" 7 | :hash 8 | "sha256:ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269") 9 | 10 | (defpkg bzip2 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/diffutils core/gcc 16 | core/make])) 17 | # XXX: these seem ignored by Makefile-libbz2_so, but used by Makefile 18 | (os/setenv "CFLAGS" 19 | *default-cflags*) 20 | (os/setenv "LDFLAGS" *default-ldflags*) 21 | (unpack-src bzip2-src) 22 | (core/link-/bin/sh) 23 | # doing this make first seems easier 24 | (sh/$? make 25 | -f Makefile-libbz2_so) 26 | (sh/$ make 27 | -j (dyn :parallelism)) 28 | (sh/$ make 29 | PREFIX= ^ (dyn :pkg-out) 30 | install) 31 | # shared results don't have install target... 32 | # XXX: if you want this, likely need to use patchelf on it 33 | #(sh/$ cp bzip2-shared 34 | # (string (dyn :pkg-out) "/bin")) 35 | (os/mkdir (string (dyn :pkg-out) "/lib")) 36 | # a symlink 37 | (sh/$ cp -P libbz2.so.1.0 38 | (string (dyn :pkg-out) "/lib")) 39 | (sh/$ cp libbz2.so.1.0.8 40 | (string (dyn :pkg-out) "/lib")))) 41 | -------------------------------------------------------------------------------- /community/capstone.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc capstone-src 5 | :file-name 6 | "capstone-4.0.2.tar.gz" 7 | :url 8 | "https://github.com/aquynh/capstone/archive/4.0.2.tar.gz" 9 | :hash 10 | "sha256:7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a") 11 | 12 | (defpkg capstone 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/coreutils 18 | core/grep 19 | core/awk 20 | core/sed 21 | core/pkgconf 22 | core/gcc core/make])) 23 | 24 | (os/setenv "CFLAGS" *default-cflags*) 25 | (os/setenv "LDFLAGS" *default-ldflags*) 26 | 27 | # XXX: this assumes x86_64 target platform. Otherwise this should be lib64, I think 28 | (os/setenv "LIBDIR" "lib") 29 | (os/setenv "PREFIX" (dyn :pkg-out)) 30 | 31 | (unpack-src capstone-src) 32 | (core/link-/bin/sh) 33 | 34 | (sh/$ make -j (dyn :parallelism)) 35 | (sh/$ make install))) 36 | -------------------------------------------------------------------------------- /community/cmake.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc cmake-src 5 | :url 6 | "https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2.tar.gz" 7 | :hash 8 | "sha256:fc77324c4f820a09052a7785549b8035ff8d3461ded5bbd80d252ae7d1cd3aa5") 9 | 10 | (defpkg cmake 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/grep core/make 16 | core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src cmake-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out) 23 | --parallel= ^ (dyn :parallelism) 24 | -- 25 | -DCMAKE_BUILD_TYPE:STRING=Release 26 | -DCMAKE_USE_OPENSSL=OFF) 27 | (sh/$ make -j (dyn :parallelism)) 28 | (sh/$ make install))) 29 | -------------------------------------------------------------------------------- /community/cpio.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc cpio-src 5 | :url 6 | "https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz" 7 | :hash 8 | "sha256:e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88") 9 | 10 | (defpkg cpio 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk 16 | core/coreutils 17 | core/gcc 18 | core/grep 19 | core/make 20 | core/sed])) 21 | (os/setenv "CFLAGS" *default-cflags*) 22 | (os/setenv "LDFLAGS" *default-ldflags*) 23 | # 24 | (unpack-src cpio-src) 25 | (core/link-/bin/sh) 26 | # 27 | (sh/$ ./configure 28 | --prefix= ^ (dyn :pkg-out)) 29 | (sh/$ make 30 | -j (dyn :parallelism)) 31 | (sh/$ make install))) 32 | -------------------------------------------------------------------------------- /community/cproc.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc qbe-src 5 | :file-name 6 | "qbe.tar.gz" 7 | :url 8 | "https://github.com/michaelforney/qbe/tarball/86b1c9af1324dae113910669caa6bff069e8631e" 9 | :hash 10 | "sha256:9547531e4512d38b6f0ebf75ae5ccb09f82089e4e7f121006429b462b80b0ddf") 11 | 12 | (defsrc cproc-src 13 | :file-name 14 | "cproc.tar.gz" 15 | :url 16 | "https://github.com/michaelforney/cproc/tarball/5cee758069a44bc8f656eeae054c19393b7381ee" 17 | :hash 18 | "sha256:caa15ec7cc98abcb24014ff84fda7c864fdfe33c76b263be0b25529a0ab860ff") 19 | 20 | (defpkg qbe 21 | :builder 22 | (fn [] 23 | (os/setenv "PATH" 24 | (join-pkg-paths ":" "/bin" 25 | [core/coreutils core/gcc core/make])) 26 | (unpack-src qbe-src) 27 | (core/link-/bin/sh) 28 | (sh/$ make install 29 | CC=gcc 30 | CFLAGS= ^ ,*default-cflags* ^ " -std=c99 --static" 31 | LDFLAGS= ^ ,*default-ldflags* ^ " --static" 32 | PREFIX= ^ (dyn :pkg-out) 33 | -j (dyn :parallelism)))) 34 | 35 | (defpkg cproc 36 | :builder 37 | (fn [] 38 | (os/setenv "PATH" 39 | (join-pkg-paths ":" "/bin" 40 | [core/coreutils core/gcc core/make])) 41 | (unpack-src cproc-src) 42 | 43 | (core/link-/bin/sh) 44 | (def as (string (dyn :pkg-out) "/bin/as")) 45 | 46 | (sh/$ ./configure 47 | CC=gcc 48 | CFLAGS= ^ ,*default-cflags* ^ " -std=c99 --static" 49 | LDFLAGS= ^ ,*default-ldflags* ^ " --static" 50 | --target=x86_64-linux-musl 51 | --prefix= ^ (dyn :pkg-out) 52 | --with-as= ^ (core/gcc :path) ^ /bin/x86_64-linux-musl-as 53 | --with-ld= ^ (core/gcc :path) ^ /bin/x86_64-linux-musl-ld 54 | --with-cpp= ^ (core/gcc :path) ^ /bin/x86_64-linux-musl-cpp 55 | --with-ldso= ^ (core/gcc-rt :path) ^ /x86_64-linux-musl/lib/ld-musl-x86_64.so.1 56 | --with-qbe= ^ (qbe :path) ^ /bin/qbe) 57 | 58 | (sh/$ make install -j (dyn :parallelism)))) 59 | -------------------------------------------------------------------------------- /community/dosfstools.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc dosfstools-src 5 | :url 6 | "https://github.com/dosfstools/dosfstools/releases/download/v4.1/dosfstools-4.1.tar.xz" 7 | :hash 8 | "sha256:e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173") 9 | 10 | (defpkg dosfstools 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/sed core/grep core/awk core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 18 | (unpack-src dosfstools-src) 19 | (core/link-/bin/sh) 20 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make -j (dyn :parallelism)) 22 | (sh/$ make install))) 23 | -------------------------------------------------------------------------------- /community/ed.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc ed-src 5 | :url 6 | "http://ftpmirror.gnu.org/ed/ed-1.16.tar.lz" 7 | :hash 8 | "sha256:cfc07a14ab048a758473ce222e784fbf031485bcd54a76f74acfee1f390d8b2c") 9 | 10 | (defpkg ed 11 | :builder 12 | (fn [] 13 | (core/link-/bin/sh) 14 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [core/coreutils core/sed core/grep 15 | core/awk core/gcc core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" *default-ldflags*) 18 | (unpack-src ed-src) 19 | (sh/$ ./configure "--prefix=" ^ (dyn :pkg-out)) 20 | (sh/$ make -j (dyn :parallelism)) 21 | (sh/$ make install))) 22 | -------------------------------------------------------------------------------- /community/file.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc file-src 5 | :url 6 | "ftp://ftp.astron.com/pub/file/file-5.38.tar.gz" 7 | :hash 8 | "sha256:593c2ffc2ab349c5aea0f55fedfe4d681737b6b62376a9b3ad1e77b2cc19fa34") 9 | 10 | (defpkg file 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/diffutils 16 | core/gcc core/grep core/make core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src file-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /community/flex.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./m4) 4 | 5 | (defsrc flex-src 6 | :url 7 | "https://github.com/westes/flex/files/981163/flex-2.6.4.tar.gz" 8 | :hash 9 | "sha256:e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995") 10 | 11 | (defpkg flex 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/coreutils core/gcc core/sed core/grep core/awk core/make 17 | m4])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 20 | (unpack-src flex-src) 21 | (core/link-/bin/sh) 22 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /community/fspec-tools.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./libarchive) 4 | (use ./lz4) 5 | (use ./patchelf) 6 | (use ./util-linux) 7 | (use ./xz) 8 | (use ./zlib) 9 | 10 | (defsrc fspec-tools-src 11 | :file-name 12 | "fspec-tools-0.0.1.tar.gz" 13 | :url 14 | "https://github.com/andrewchambers/fspec-tools/archive/v0.0.1.tar.gz" 15 | :hash 16 | "sha256:2957324ea3cf271f839ba216486f33e194a76778005127baf0082062a2bf29a8") 17 | 18 | (defpkg fspec-tools 19 | :builder 20 | (fn [] 21 | (os/setenv "PATH" 22 | (join-pkg-paths ":" "/bin" 23 | [core/coreutils 24 | core/gcc 25 | core/make 26 | patchelf])) 27 | (os/setenv "CFLAGS" 28 | (string *default-cflags* 29 | " " 30 | "-I" (libarchive :path) "/include" 31 | " " 32 | "-I" (lz4 :path) "/include" 33 | " " 34 | "-I" (xz :path) "/include" 35 | " " 36 | "-I" (zlib :path) "/include")) 37 | (os/setenv "LDFLAGS" 38 | (string *default-ldflags* 39 | " " 40 | "-L" (libarchive :path) "/lib" 41 | " " 42 | "-L" (lz4 :path) "/lib" 43 | " " 44 | "-L" (xz :path) "/lib" 45 | " " 46 | "-L" (zlib :path) "/lib")) 47 | (os/setenv "LDLIBS" 48 | (string "-l lzma" 49 | " " 50 | "-l lz4" 51 | " " 52 | "-l z")) 53 | (os/setenv "CC" "gcc") 54 | # 55 | (unpack-src fspec-tools-src) 56 | (rewrite "Makefile" 57 | |(string/replace "LDLIBS=" 58 | "LDLIBS+=" 59 | $)) 60 | (core/link-/bin/sh) 61 | # 62 | (sh/$ make 63 | PREFIX= ^ (dyn :pkg-out) 64 | -j (dyn :parallelism)) 65 | (sh/$ make 66 | PREFIX= ^ (dyn :pkg-out) 67 | install) 68 | # 69 | (each exe ["fspec-cpio" "fspec-fromcpio" "fspec-fromdir" "fspec-fromtar" 70 | "fspec-tar"] 71 | (sh/$ patchelf --set-rpath 72 | (join-pkg-paths ":" "/lib" 73 | [libarchive lz4 xz zlib]) 74 | (string (dyn :pkg-out) "/bin/" exe))))) 75 | -------------------------------------------------------------------------------- /community/gettext.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc gettext-src 5 | :url 6 | "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.tar.xz" 7 | :hash 8 | "sha256:a248207fd726ca35c57fe9f01e748c36c60b864bb624b58f9983a0f98b633924") 9 | 10 | (defpkg gettext 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (string "/bin:" # XXX: for /bin/sh 15 | (join-pkg-paths ":" "/bin" 16 | [core/awk core/coreutils core/diffutils 17 | core/findutils core/gcc core/grep 18 | core/gzip core/make core/sed]))) 19 | (os/setenv "CFLAGS" *default-cflags*) 20 | (os/setenv "LDFLAGS" 21 | (string *default-ldflags* 22 | " " 23 | # use RUNPATH 24 | "-Wl,--enable-new-dtags")) 25 | (unpack-src gettext-src) 26 | (core/link-/bin/sh) 27 | (sh/$ ./configure 28 | --prefix= ^ (dyn :pkg-out)) 29 | (sh/$ make 30 | PREFIX= ^ (dyn :pkg-out) 31 | # XXX: might cause error(?) 32 | #-j (dyn :parallelism) 33 | ) 34 | (sh/$ make 35 | PREFIX= ^ (dyn :pkg-out) 36 | install))) 37 | -------------------------------------------------------------------------------- /community/go.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (import ./bash) 4 | 5 | (defsrc bootstrap-go-src 6 | :url "https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz" 7 | :hash "sha256:f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52") 8 | 9 | (defsrc go-src 10 | :url "https://dl.google.com/go/go1.14.3.src.tar.gz" 11 | :hash "sha256:93023778d4d1797b7bc6a53e86c3a9b150c923953225f8a48a2d5fabc971af56") 12 | 13 | (defpkg go 14 | :builder 15 | (fn [] 16 | (core/link-/bin/sh) 17 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [bash/bash core/build-env])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" *default-ldflags*) 20 | (os/setenv "TMPDIR" "/tmp") 21 | (os/mkdir "go1.4") 22 | (os/cd "go1.4") 23 | (os/setenv "GOROOT_BOOTSTRAP" (os/cwd)) 24 | (unpack-src bootstrap-go-src) 25 | (os/cd "src") 26 | (sh/$ bash "./make.bash") 27 | (os/cd (dyn :pkg-out)) 28 | (unpack-src go-src) 29 | (os/cd "src") 30 | (sh/$ bash "./make.bash"))) 31 | -------------------------------------------------------------------------------- /community/janet.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc janet-src 5 | :file-name 6 | "janet.tar.gz" 7 | :url 8 | "https://github.com/janet-lang/janet/archive/v1.9.1.tar.gz" 9 | :hash 10 | "sha256:02724d6074a0d6fa53a548e8bdaaf49999f082e30b277c73444900f739a53062") 11 | 12 | (defpkg janet 13 | :builder 14 | (fn [] 15 | (core/link-/bin/sh) 16 | (os/setenv "PATH" (pkg-path "/bin" core/build-env)) 17 | (unpack-src janet-src) 18 | (sh/$ make PREFIX= ^ (dyn :pkg-out) -j (dyn :parallelism)) 19 | (sh/$ make PREFIX= ^ (dyn :pkg-out) install))) 20 | -------------------------------------------------------------------------------- /community/less.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | 5 | (defsrc less-src 6 | :url 7 | "http://www.greenwoodsoftware.com/less/less-551.tar.gz" 8 | :hash 9 | "sha256:ff165275859381a63f19135a8f1f6c5a194d53ec3187f94121ecd8ef0795fe3d") 10 | 11 | (defpkg less 12 | :builder 13 | (fn [] 14 | (os/setenv "PKG_CONFIG_PATH" 15 | (string (ncurses :path) "/lib/pkgconfig")) 16 | (os/setenv "PATH" 17 | (string "/bin:" 18 | (join-pkg-paths ":" "/bin" 19 | [core/awk core/coreutils core/gcc 20 | core/grep core/make core/pkgconf 21 | core/sed]))) 22 | (os/setenv "CFLAGS" 23 | (string *default-cflags* 24 | " " 25 | (sh/$<_ pkg-config --cflags ncurses))) 26 | (os/setenv "LDFLAGS" 27 | (string *default-ldflags* 28 | " " 29 | (sh/$<_ pkg-config --libs ncurses))) 30 | # placate configure 31 | (os/setenv "LD_LIBRARY_PATH" 32 | (string (ncurses :path) "/lib")) 33 | (core/link-/bin/sh) 34 | (unpack-src less-src) 35 | (sh/$ ./configure 36 | --prefix= ^ (dyn :pkg-out)) 37 | (sh/$ make 38 | -j (dyn :parallelism)) 39 | (sh/$ make install))) 40 | -------------------------------------------------------------------------------- /community/libarchive.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./bzip2) 4 | (use ./lz4) 5 | (use ./xz) 6 | (use ./zlib) 7 | 8 | (defsrc libarchive-src 9 | :url 10 | "https://github.com/libarchive/libarchive/releases/download/v3.4.2/libarchive-3.4.2.tar.gz" 11 | :hash 12 | "sha256:b60d58d12632ecf1e8fad7316dc82c6b9738a35625746b47ecdcaf4aed176176") 13 | 14 | (defpkg libarchive 15 | :builder 16 | (fn [] 17 | (os/setenv "PKG_CONFIG_PATH" 18 | (join-pkg-paths ":" "/lib/pkgconfig" 19 | [lz4 xz zlib])) 20 | (os/setenv "PATH" 21 | (join-pkg-paths ":" "/bin" 22 | [core/awk core/coreutils core/gcc core/grep 23 | core/make core/pkgconf core/sed])) 24 | (os/setenv "CFLAGS" 25 | (string *default-cflags* 26 | " " 27 | "-I" (bzip2 :path) "/include" 28 | " " 29 | (sh/$<_ pkg-config --cflags liblz4 liblzma zlib))) 30 | (os/setenv "LDFLAGS" 31 | (string *default-ldflags* 32 | " " 33 | "-L" (bzip2 :path) "/lib" 34 | " " 35 | "-Wl,-rpath=" (join-pkg-paths ":" "/lib" 36 | [lz4 xz zlib]) 37 | " " 38 | (sh/$<_ pkg-config --libs zlib liblz4 liblzma) 39 | " " 40 | "-lbz2")) 41 | (unpack-src libarchive-src) 42 | (core/link-/bin/sh) 43 | (sh/$ ./configure 44 | --prefix= ^ (dyn :pkg-out)) 45 | (sh/$ make 46 | -j (dyn :parallelism)) 47 | (sh/$ make install) 48 | (rewrite (string (dyn :pkg-out) "/lib/pkgconfig/libarchive.pc") 49 | |(string/replace "Libs: " 50 | (string "Libs: -Wl,-rpath=" (dyn :pkg-out) "/lib ") 51 | $)))) -------------------------------------------------------------------------------- /community/libbsd.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc libbsd-src 5 | :url 6 | "https://libbsd.freedesktop.org/releases/libbsd-0.10.0.tar.xz" 7 | :hash 8 | "sha256:34b8adc726883d0e85b3118fa13605e179a62b31ba51f676136ecb2d0bc1a887") 9 | 10 | (defpkg libbsd 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/diffutils core/gcc 16 | core/grep core/make core/sed])) 17 | (unpack-src libbsd-src) 18 | (core/link-/bin/sh) 19 | (sh/$ ./configure 20 | --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make 22 | -j (dyn :parallelism)) 23 | (sh/$ make 24 | install))) 25 | -------------------------------------------------------------------------------- /community/libedit.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | 5 | (defsrc libedit-src 6 | :url 7 | "http://thrysoee.dk/editline/libedit-20191231-3.1.tar.gz" 8 | :hash 9 | "sha256:dbb82cb7e116a5f8025d35ef5b4f7d4a3cdd0a3909a146a39112095a2d229071") 10 | 11 | (defpkg libedit 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (string "/bin:" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk core/coreutils core/gcc 18 | core/grep core/make core/pkgconf 19 | core/sed]))) 20 | (os/setenv "PKG_CONFIG_PATH" 21 | (string (ncurses :path) "/lib/pkgconfig")) 22 | (os/setenv "CFLAGS" 23 | (string 24 | *default-cflags* 25 | " " 26 | (sh/$<_ pkg-config --cflags ncurses))) 27 | (os/setenv "LDFLAGS" 28 | (string 29 | *default-ldflags* 30 | " " 31 | (sh/$<_ pkg-config --libs ncurses))) 32 | (unpack-src libedit-src) 33 | (core/link-/bin/sh) 34 | (sh/$ ./configure 35 | --prefix= ^ (dyn :pkg-out)) 36 | (sh/$ make 37 | -j (dyn :parallelism)) 38 | (sh/$ make install) 39 | (rewrite (string (dyn :pkg-out) "/lib/pkgconfig/libedit.pc") 40 | |(string/replace "Libs: " 41 | (string "Libs: -Wl,-rpath=" (ncurses :path) "/lib" 42 | " " 43 | "-L" (ncurses :path) "/lib" 44 | " " 45 | "-lncurses" 46 | " ") 47 | $)))) 48 | -------------------------------------------------------------------------------- /community/libevent.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./file) 4 | (use ./python3) 5 | 6 | (defsrc libevent-src 7 | :url 8 | "https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz" 9 | :hash 10 | "sha256:a65bac6202ea8c5609fd5c7e480e6d25de467ea1917c08290c521752f147283d") 11 | 12 | (defpkg libevent 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk 18 | core/coreutils 19 | core/diffutils 20 | core/gcc 21 | core/grep 22 | core/make 23 | core/sed])) 24 | (os/setenv "CFLAGS" *default-cflags*) 25 | (os/setenv "LDFLAGS" *default-ldflags*) 26 | (unpack-src libevent-src) 27 | (core/link-/bin/sh) 28 | # XXX: may end up using system's env for non-chrooted setups 29 | (unless (os/lstat "/usr/bin/env") 30 | (os/symlink (string (core/coreutils :path) "/bin/env") 31 | "/usr/bin/env")) 32 | # XXX: may end up using system's env for non-chrooted setups 33 | (unless (os/lstat "/usr/bin/file") 34 | (os/symlink (string (file :path) "/bin/file") 35 | "/usr/bin/file")) 36 | # XXX: may end up using system's python for non-chrooted setups 37 | (unless (os/lstat "/usr/bin/python") 38 | (os/symlink (string (python3 :path) "/bin/python3") 39 | "/usr/bin/python")) 40 | (sh/$ ./configure 41 | --prefix= ^ (dyn :pkg-out)) 42 | (sh/$ make -j (dyn :parallelism)) 43 | (sh/$ make install) 44 | # XXX: change path in .py file that's in bin? 45 | )) 46 | -------------------------------------------------------------------------------- /community/libffi.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./file) 4 | 5 | (defsrc libffi-src 6 | :url 7 | "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" 8 | :hash 9 | "sha256:72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056") 10 | 11 | (defpkg libffi 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (string "/bin:" # for finding sh 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk 18 | core/coreutils 19 | core/diffutils 20 | core/gcc 21 | core/grep 22 | core/make 23 | core/sed]))) 24 | (os/setenv "CFLAGS" *default-cflags*) 25 | (os/setenv "LDFLAGS" *default-ldflags*) 26 | (unpack-src libffi-src) 27 | (core/link-/bin/sh) 28 | # XXX: may end up using system's env for non-chrooted setups 29 | (unless (os/lstat "/usr/bin/file") 30 | (os/symlink (string (file :path) "/bin/file") 31 | "/usr/bin/file")) 32 | (sh/$ ./configure 33 | --prefix= ^ (dyn :pkg-out)) 34 | (sh/$ make 35 | -j (dyn :parallelism)) 36 | (sh/$ make install))) 37 | -------------------------------------------------------------------------------- /community/libsodium.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc libsodium-src 5 | :url 6 | "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz" 7 | :hash 8 | "sha256:6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1") 9 | 10 | (defpkg libsodium 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/diffutils core/gcc 16 | core/grep core/make core/sed core/findutils])) 17 | (unpack-src libsodium-src) 18 | (core/link-/bin/sh) 19 | (sh/$ ./configure 20 | --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make V=1 22 | -j (dyn :parallelism)) 23 | (sh/$ make 24 | install))) 25 | -------------------------------------------------------------------------------- /community/libtool.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | # XXX: precise shell can make difference 4 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512013 5 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518905 6 | #(use ./bash) 7 | #(use ./busybox) 8 | (use ./m4) 9 | (use ./perl) 10 | 11 | (defsrc libtool-src 12 | :url 13 | "https://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.xz" 14 | :hash 15 | "sha256:afcce660d3dc54c63a0a5ba3cf05272239dc3c54bbeba20f6bad250f9dc007ae") 16 | 17 | (defpkg libtool 18 | :builder 19 | (fn [] 20 | # XXX: see shell remark above 21 | (os/setenv "PATH" 22 | (join-pkg-paths ":" "/bin" 23 | #[awk bash coreutils diffutils gcc grep m4 make perl sed])) 24 | #[awk busybox coreutils diffutils gcc grep m4 make perl sed])) 25 | [core/awk core/coreutils core/dash 26 | core/diffutils core/gcc core/grep 27 | m4 core/make perl core/sed])) 28 | (os/setenv "CFLAGS" *default-cflags*) 29 | (os/setenv "LDFLAGS" *default-ldflags*) 30 | (unpack-src libtool-src) 31 | # XXX: see shell remark above 32 | (core/link-/bin/sh) 33 | #(unless (os/lstat "/bin/sh") 34 | # (os/symlink (string (bash :path) "/bin/bash") 35 | # (os/symlink (string (busybox :path) "/bin/sh") 36 | # "/bin/sh")) 37 | (sh/$ ./configure 38 | --prefix= ^ (dyn :pkg-out)) 39 | (sh/$ make -j (dyn :parallelism)) 40 | (sh/$ make install))) 41 | -------------------------------------------------------------------------------- /community/libuv.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./cmake) 4 | 5 | (defsrc libuv-src 6 | :file-name 7 | "libuv-1.38.0.tar.gz" 8 | :url 9 | "https://github.com/libuv/libuv/archive/v1.38.0.tar.gz" 10 | :hash 11 | "sha256:2cd9a757fe6c512440933e2bdcab21143d4aa6249b2541399908ce038b756c9d") 12 | 13 | (defpkg libuv 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (join-pkg-paths ":" "/bin" 18 | [core/coreutils 19 | core/gcc 20 | core/grep 21 | core/make 22 | core/patch 23 | core/sed 24 | core/awk 25 | cmake 26 | core/pkgconf])) 27 | (os/setenv "CFLAGS" *default-cflags*) 28 | (os/setenv "LDFLAGS" *default-ldflags*) 29 | 30 | (core/link-/bin/sh) 31 | (unpack-src libuv-src) 32 | 33 | (os/mkdir "build") 34 | (os/cd "build") 35 | (sh/$ cmake 36 | -DCMAKE_INSTALL_PREFIX= ^ (dyn :pkg-out) 37 | "..") 38 | 39 | (sh/$ make 40 | -j (dyn :parallelism)) 41 | (sh/$ make install))) 42 | -------------------------------------------------------------------------------- /community/libzip.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./cmake) 4 | (use ./zlib) 5 | 6 | (defsrc libzip-src 7 | :file-name 8 | "libzip-1-6-1.tar.gz" 9 | :url 10 | "https://github.com/nih-at/libzip/archive/rel-1-6-1.tar.gz" 11 | :hash 12 | "sha256:4f4e1991bf6b592e3d602d6b7b753c53ddadb2d76fca27d58120b8fadef7f1bf") 13 | 14 | (defpkg libzip 15 | :builder 16 | (fn [] 17 | (os/setenv "PKG_CONFIG_PATH" 18 | (join-pkg-paths ":" "/lib/pkgconfig" 19 | [zlib])) 20 | 21 | (os/setenv "PATH" 22 | (join-pkg-paths ":" "/bin" 23 | [core/awk 24 | core/coreutils 25 | core/pkgconf 26 | core/gcc 27 | core/grep 28 | core/make 29 | core/sed 30 | cmake])) 31 | 32 | (os/setenv "CFLAGS" 33 | (string *default-cflags* 34 | " " 35 | (sh/$<_ pkg-config --cflags zlib))) 36 | (os/setenv "LDFLAGS" 37 | (string *default-ldflags* 38 | " " 39 | "-Wl,--enable-new-dtags" 40 | " " 41 | "-Wl,-rpath=" (string 42 | (dyn :pkg-out) "/lib64" 43 | ":" 44 | (join-pkg-paths ":" "/lib" 45 | [zlib])) 46 | " " 47 | (sh/$<_ pkg-config --libs zlib))) 48 | 49 | (unpack-src libzip-src) 50 | (core/link-/bin/sh) 51 | 52 | (os/mkdir "build") 53 | (os/cd "build") 54 | (sh/$ cmake 55 | # in this case, cmake does not seem to honour the -I, -l 56 | # and -L switches fully, so 57 | -DZLIB_INCLUDE_DIR= ^ (string (zlib :path) "/include") 58 | -DZLIB_LIBRARY= ^ (string (zlib :path) "/lib") 59 | -DCMAKE_INSTALL_PREFIX= ^ (dyn :pkg-out) 60 | "..") 61 | 62 | (sh/$ make 63 | -j (dyn :parallelism)) 64 | (sh/$ make install))) 65 | -------------------------------------------------------------------------------- /community/llvmorg.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./cmake) 4 | (use ./ninja) 5 | (use ./python3) # for tests 6 | 7 | (defsrc llvmorg-src 8 | :url 9 | "https://github.com/llvm/llvm-project/archive/llvmorg-10.0.0.tar.gz" 10 | :hash 11 | "sha256:b81c96d2f8f40dc61b14a167513d87c0d813aae0251e06e11ae8a4384ca15451") 12 | 13 | # https://llvm.org/docs/GettingStarted.html#software 14 | (defpkg clang 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (string "/bin:" 19 | (join-pkg-paths ":" "/bin" 20 | [cmake 21 | core/coreutils 22 | core/gcc 23 | core/grep 24 | ninja 25 | python3 26 | core/sed]))) 27 | (os/setenv "CFLAGS" *default-cflags*) 28 | (os/setenv "LDFLAGS" *default-ldflags*) 29 | (unpack-src llvmorg-src) 30 | # XXX: unsure if this is necessary 31 | (rewrite "clang/lib/Driver/ToolChains/Gnu.cpp" 32 | |(string/replace 33 | " \"x86_64-slackware-linux\", \"x86_64-unknown-linux\"," 34 | (string " \"x86_64-slackware-linux\", \"x86_64-unknown-linux\"," 35 | " \"x86_64-musl-linux\",") 36 | $)) 37 | # this rewriting is necessary 38 | (rewrite "clang/lib/Driver/ToolChains/Linux.cpp" 39 | |(string/replace 40 | " return \"/lib/ld-musl-\" + ArchName + \".so.1\";" 41 | # /hpkg/-rt/x86_64-linux-musl/lib/ld-musl-x86_64.so.1 42 | # ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ 43 | (string " return " 44 | "\"" 45 | (core/gcc-rt :path) "/" 46 | "\"" 47 | " + ArchName + " 48 | "\"" 49 | "-linux-musl/lib/ld-musl-" 50 | "\"" 51 | " + ArchName + " 52 | "\".so.1\";") 53 | $)) 54 | # 55 | (core/link-/bin/sh) 56 | # XXX: use cmake options instead of mkdir / cd? 57 | (os/mkdir "build") 58 | (os/cd "build") 59 | # https://llvm.org/docs/CMake.html#llvm-specific-variables 60 | (sh/$ cmake 61 | -G Ninja 62 | -DCMAKE_INSTALL_PREFIX= ^ (dyn :pkg-out) 63 | -DCMAKE_BUILD_TYPE= ^ Release 64 | # XXX: apparently zig needs it all... 65 | #-DLLVM_TARGETS_TO_BUILD= ^ "X86" 66 | -DLLVM_ENABLE_PROJECTS= ^ "clang" 67 | # XXX: trying to remove python dep but failed 68 | -DLLVM_BUILD_TESTS= ^ OFF 69 | -DLLVM_INCLUDE_TESTS= ^ OFF 70 | # XXX: https://llvm.org/docs/HowToCrossCompileLLVM.html 71 | -DCMAKE_CXX_FLAGS= ^ "'-march=x86-64'" 72 | -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-musl 73 | -target x86_64-musl-linux 74 | --sysroot= ^ (core/gcc :path) ^ "/x86_64-linux-musl" 75 | ../llvm) 76 | (sh/$ cmake 77 | --build . 78 | -j (dyn :parallelism)) 79 | (sh/$ cmake 80 | --build . 81 | --target install))) 82 | 83 | (defpkg lld 84 | :builder 85 | (fn [] 86 | (os/setenv "PATH" 87 | (string "/bin:" 88 | (join-pkg-paths ":" "/bin" 89 | [cmake 90 | core/coreutils 91 | core/gcc 92 | core/grep 93 | ninja 94 | python3 95 | core/sed]))) 96 | (os/setenv "CFLAGS" *default-cflags*) 97 | (os/setenv "LDFLAGS" *default-ldflags*) 98 | (unpack-src llvmorg-src) 99 | (core/link-/bin/sh) 100 | # XXX: use cmake options instead of mkdir / cd? 101 | (os/mkdir "build") 102 | (os/cd "build") 103 | # https://llvm.org/docs/CMake.html#llvm-specific-variables 104 | (sh/$ cmake 105 | -G Ninja 106 | -DCMAKE_INSTALL_PREFIX= ^ (dyn :pkg-out) 107 | -DCMAKE_BUILD_TYPE= ^ Release 108 | # XXX: apparently zig needs it all... 109 | #-DLLVM_TARGETS_TO_BUILD= ^ "X86" 110 | -DLLVM_ENABLE_PROJECTS= ^ "lld" 111 | # XXX: trying to remove python dep but failed 112 | -DLLVM_BUILD_TESTS= ^ OFF 113 | -DLLVM_INCLUDE_TESTS= ^ OFF 114 | # XXX: https://llvm.org/docs/HowToCrossCompileLLVM.html 115 | -DCMAKE_CXX_FLAGS= ^ "'-march=x86-64'" 116 | -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-musl 117 | -target x86_64-musl-linux 118 | --sysroot= ^ (core/gcc :path) ^ "/x86_64-linux-musl" 119 | ../llvm) 120 | (sh/$ cmake 121 | --build . 122 | -j (dyn :parallelism)) 123 | (sh/$ cmake 124 | --build . 125 | --target install))) 126 | -------------------------------------------------------------------------------- /community/luajit.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./busybox) 4 | 5 | (defsrc luajit-src 6 | :file-name 7 | "luajit.tar.gz" 8 | :url 9 | "https://github.com/LuaJIT/LuaJIT/archive/v2.0.5.tar.gz" 10 | :hash 11 | "sha256:8bb29d84f06eb23c7ea4aa4794dbb248ede9fcb23b6989cbef81dc79352afc97") 12 | 13 | (defpkg luajit 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (join-pkg-paths ":" "/bin" 18 | [core/coreutils 19 | core/gcc 20 | busybox 21 | core/make])) 22 | (os/setenv "CFLAGS" 23 | *default-cflags*) 24 | (os/setenv "LDFLAGS" *default-ldflags*) 25 | (unpack-src luajit-src) 26 | (core/link-/bin/sh) 27 | (sh/$ make 28 | -j (dyn :parallelism)) 29 | (sh/$ make 30 | PREFIX= ^ (dyn :pkg-out) 31 | install) 32 | )) 33 | -------------------------------------------------------------------------------- /community/luarocks.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./autoconf) 4 | (use ./busybox) 5 | (use ./luajit) 6 | 7 | (defsrc luarocks-src 8 | :file-name 9 | "luarocks-3.3.1.tar.gz" 10 | :url 11 | "https://github.com/luarocks/luarocks/archive/v3.3.1.tar.gz" 12 | :hash 13 | "sha256:837481e408f7c06b59befe7ec194537c657687d624894bca7f79034302141a34") 14 | 15 | (defpkg luarocks 16 | :builder 17 | (fn [] 18 | (os/setenv "PATH" 19 | (string "/bin:" 20 | (join-pkg-paths ":" "/bin" 21 | [core/coreutils 22 | core/gcc 23 | autoconf 24 | luajit 25 | busybox 26 | core/make]))) 27 | (os/setenv "CFLAGS" 28 | *default-cflags*) 29 | (os/setenv "LDFLAGS" 30 | *default-ldflags*) 31 | (unpack-src luarocks-src) 32 | (core/link-/bin/sh) 33 | (sh/$ ./configure 34 | --with-lua= ^ (luajit :path) 35 | --prefix= ^ (dyn :pkg-out)) 36 | (sh/$ make 37 | -j (dyn :parallelism)) 38 | (sh/$ make 39 | install) 40 | )) 41 | -------------------------------------------------------------------------------- /community/lz4.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc lz4-src 5 | :file-name 6 | "lz4-1.9.2.tar.gz" 7 | :url 8 | "https://github.com/lz4/lz4/archive/v1.9.2.tar.gz" 9 | :hash 10 | "sha256:658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc") 11 | 12 | (defpkg lz4 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/coreutils core/gcc core/make core/sed])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" *default-ldflags*) 20 | (unpack-src lz4-src) 21 | (core/link-/bin/sh) 22 | (sh/$ make 23 | -j (dyn :parallelism)) 24 | (sh/$ make 25 | PREFIX= ^ (dyn :pkg-out) 26 | install))) 27 | -------------------------------------------------------------------------------- /community/lzip.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc lzip-src 5 | :url 6 | "http://download.savannah.gnu.org/releases/lzip/lzip-1.21.tar.gz" 7 | :hash 8 | "sha256:e48b5039d3164d670791f9c5dbaa832bf2df080cb1fbb4f33aa7b3300b670d8b") 9 | 10 | (defpkg lzip 11 | :builder 12 | (fn [] 13 | (core/link-/bin/sh) 14 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [core/coreutils core/sed core/grep 15 | core/awk core/gcc core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" *default-ldflags*) 18 | (unpack-src lzip-src) 19 | (sh/$ ./configure "--prefix=" ^ (dyn :pkg-out)) 20 | (sh/$ make -j (dyn :parallelism)) 21 | (sh/$ make install))) 22 | -------------------------------------------------------------------------------- /community/m4.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc m4-src 5 | :url 6 | "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz" 7 | :hash 8 | "sha256:f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07") 9 | 10 | (defpkg m4 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/gcc core/grep 16 | core/make core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src m4-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /community/mcpp.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc mcpp-src 5 | :url 6 | "http://prdownloads.sourceforge.net/mcpp/mcpp-2.7.2.tar.gz?download" 7 | :hash 8 | "sha256:3b9b4421888519876c4fc68ade324a3bbd81ceeb7092ecdbbc2055099fcb8864") 9 | 10 | (defpkg mcpp 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/sed core/grep core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" *default-ldflags*) 18 | (unpack-src mcpp-src) 19 | (core/link-/bin/sh) 20 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make -j (dyn :parallelism)) 22 | (sh/$ make install))) 23 | -------------------------------------------------------------------------------- /community/meson.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./python3) 4 | 5 | (defsrc meson-src 6 | :file-name 7 | "meson-0.54.2.tar.gz" 8 | :url 9 | "https://github.com/mesonbuild/meson/archive/0.54.2.tar.gz" 10 | :hash 11 | "sha256:85cafdc70ae7d1d9d506e7356b917c649c4df2077bd6a0382db37648aa4ecbdb") 12 | 13 | (defpkg meson 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (join-pkg-paths ":" "/bin" 18 | [core/coreutils python3])) 19 | (unpack-src meson-src) 20 | (os/setenv "PYTHONPATH" 21 | (dyn :pkg-out)) 22 | (sh/$ python3 -m venv 23 | (dyn :pkg-out) ^ "/venv") 24 | (sh/$ (dyn :pkg-out) ^ "/venv/bin/python3" 25 | setup.py 26 | install) 27 | (os/mkdir (string (dyn :pkg-out) "/bin")) 28 | (os/symlink (string (dyn :pkg-out) "/venv/bin/meson") 29 | (string (dyn :pkg-out) "/bin/meson")))) 30 | -------------------------------------------------------------------------------- /community/mrsh.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./libedit) 4 | (use ./ncurses) 5 | (use ./patchelf) 6 | 7 | (defsrc mrsh-src 8 | :file-name 9 | "mrsh.tar.gz" 10 | :url 11 | "https://github.com/emersion/mrsh/tarball/819e0495ca9e0db1a5459892aefdb2608b397d0a" 12 | :hash 13 | "sha256:8c9374ed5d37ef298c2d2ed4176775f0bd5573f103487465f401d8b31e662279") 14 | 15 | (defpkg mrsh 16 | :builder 17 | (fn [] 18 | (os/setenv "PKG_CONFIG_PATH" 19 | (join-pkg-paths ":" "/lib/pkgconfig" 20 | [libedit ncurses])) 21 | (os/setenv "PATH" 22 | (join-pkg-paths ":" "/bin" 23 | [core/coreutils core/gcc core/grep 24 | core/make patchelf core/pkgconf])) 25 | (os/setenv "CFLAGS" *default-cflags*) 26 | (os/setenv "LDFLAGS" *default-ldflags*) 27 | (core/link-/bin/sh) 28 | (unpack-src mrsh-src) 29 | (sh/$ ./configure 30 | --prefix= ^ (dyn :pkg-out)) 31 | (sh/$ make 32 | -j (dyn :parallelism)) 33 | (sh/$ make 34 | install) 35 | (sh/$ patchelf 36 | --set-rpath (string (dyn :pkg-out) "/lib" 37 | ":" 38 | (join-pkg-paths ":" "/lib" [ncurses libedit])) 39 | (dyn :pkg-out) ^ "/bin/mrsh"))) 40 | -------------------------------------------------------------------------------- /community/mtools.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc mtools-src 5 | :url 6 | "ftp://ftp.gnu.org/gnu/mtools/mtools-4.0.24.tar.bz2" 7 | :hash 8 | "sha256:24f4a2da9219f98498eb1b340cd96db7ef9b684c067d1bdeb6e85efdd13b2fb9") 9 | 10 | (defpkg mtools 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/sed core/grep core/awk core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 18 | (unpack-src mtools-src) 19 | (core/link-/bin/sh) 20 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make -j (dyn :parallelism)) 22 | (sh/$ make install))) 23 | -------------------------------------------------------------------------------- /community/nano.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | 5 | (defsrc nano-src 6 | :url 7 | "https://www.nano-editor.org/dist/v4/nano-4.9.3.tar.xz" 8 | :hash 9 | "sha256:6e3438f033a0ed07d3d74c30d0803cbda3d2366ba1601b7bbf9b16ac371f51b4") 10 | 11 | (defpkg nano 12 | :builder 13 | (fn [] 14 | (os/setenv "PKG_CONFIG_PATH" 15 | (join-pkg-paths ":" "/lib/pkgconfig" 16 | [ncurses])) 17 | (os/setenv "PATH" 18 | (join-pkg-paths ":" "/bin" 19 | [core/awk core/coreutils 20 | core/gcc core/grep core/make 21 | core/pkgconf core/sed])) 22 | (os/setenv "CFLAGS" 23 | (string *default-cflags* 24 | " " 25 | (sh/$<_ pkg-config --cflags ncurses))) 26 | (os/setenv "LDFLAGS" 27 | (string *default-ldflags* 28 | " " 29 | (sh/$<_ pkg-config --libs ncurses))) 30 | (unpack-src nano-src) 31 | (core/link-/bin/sh) 32 | (sh/$ ./configure 33 | --prefix= ^ (dyn :pkg-out)) 34 | (sh/$ make 35 | -j (dyn :parallelism)) 36 | (sh/$ make install))) 37 | -------------------------------------------------------------------------------- /community/nasm.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (use ./perl) 3 | (import ../core) 4 | 5 | (defsrc nasm-src 6 | :url 7 | "https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.xz" 8 | :hash 9 | "sha256:e24ade3e928f7253aa8c14aa44726d1edf3f98643f87c9d72ec1df44b26be8f5") 10 | 11 | (defpkg nasm 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/coreutils core/gcc core/sed core/findutils 17 | core/grep core/awk core/make perl])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 20 | (unpack-src nasm-src) 21 | (core/link-/bin/sh) 22 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /community/ncurses.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc ncurses-src 5 | :url 6 | "https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz" 7 | :hash 8 | "sha256:30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d") 9 | 10 | (defpkg ncurses 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (string "/bin:" # for /bin/sh access 15 | (join-pkg-paths ":" "/bin" 16 | [core/awk core/coreutils 17 | core/diffutils core/gcc core/grep 18 | core/make core/pkgconf core/sed]))) 19 | (os/setenv "CFLAGS" *default-cflags*) 20 | # XXX: things placed here seem to end up in the .pc files 21 | (os/setenv "LDFLAGS" (string *default-ldflags* 22 | " " 23 | "-Wl,-L" (dyn :pkg-out) "/lib" 24 | " " 25 | "-Wl,-rpath=" (dyn :pkg-out) "/lib")) 26 | (unpack-src ncurses-src) 27 | (core/link-/bin/sh) 28 | (sh/$ ./configure 29 | --with-shared 30 | --enable-pc-files 31 | # XXX: unsure what consequences are... 32 | #--enable-widec 33 | # XXX: check this in detail 34 | --with-pkg-config-libdir= ^ (dyn :pkg-out) ^ "/lib/pkgconfig" 35 | --prefix= ^ (dyn :pkg-out)) 36 | (sh/$ make 37 | PREFIX= ^ (dyn :pkg-out) 38 | -j (dyn :parallelism)) 39 | (sh/$ make 40 | PREFIX= ^ (dyn :pkg-out) 41 | install))) 42 | -------------------------------------------------------------------------------- /community/nginx.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./file) 4 | (use ./openssl) 5 | (use ./pcre) 6 | (use ./zlib) 7 | 8 | # NOTE to start nginx from a hpkg, you probably need to invoke the binary with 9 | # the -p switch (prefix) so nginx doesn't try to create directories and stuff 10 | # inside the hpkg. 11 | 12 | (defsrc nginx-src 13 | :file-name 14 | "nginx-1.17.10.tar.gz" 15 | :url 16 | "https://nginx.org/download/nginx-1.17.10.tar.gz" 17 | :hash 18 | "sha256:a9aa73f19c352a6b166d78e2a664bb3ef1295bbe6d3cc5aa7404bd4664ab4b83") 19 | 20 | (defpkg nginx 21 | :builder 22 | (fn [] 23 | (os/setenv "PATH" 24 | (string "/bin:" 25 | (join-pkg-paths ":" "/bin" 26 | [core/awk 27 | core/coreutils 28 | core/diffutils 29 | file 30 | core/gcc 31 | core/grep 32 | core/make 33 | core/sed]))) 34 | # XXX: may end up using system's file for non-chrooted setups 35 | (unless (os/lstat "/usr/bin/file") 36 | (os/mkdir "/usr") 37 | (os/mkdir "/usr/bin") 38 | (os/symlink (string (file :path) "/bin/file") 39 | "/usr/bin/file")) 40 | (os/setenv "CFLAGS" *default-cflags*) 41 | (os/setenv "LDFLAGS" *default-ldflags*) 42 | (unpack-src nginx-src) 43 | (core/link-/bin/sh) 44 | (unpack-src openssl-src) 45 | (unpack-src pcre-src) 46 | (unpack-src zlib-src) 47 | (sh/$ ./configure 48 | --prefix= ^ (dyn :pkg-out) 49 | # XXX: hmmm...version numbers... 50 | --with-openssl= ^ ./openssl-1.1.1g 51 | --with-pcre= ^ ./pcre-8.44 52 | --with-zlib= ^ ./zlib-1.2.11) 53 | (sh/$ make 54 | -j (dyn :parallelism)) 55 | (sh/$ make 56 | install))) 57 | -------------------------------------------------------------------------------- /community/ninja.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./cmake) 4 | (use ./re2c) 5 | 6 | (defsrc ninja-src 7 | :file-name 8 | "ninja-1.10.0.tar.gz" 9 | :url 10 | "https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz" 11 | :hash 12 | "sha256:3810318b08489435f8efc19c05525e80a993af5a55baa0dfeae0465a9d45f99f") 13 | 14 | (defpkg ninja 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (string "/bin:" 19 | (join-pkg-paths ":" "/bin" 20 | [cmake core/coreutils core/gcc 21 | core/make re2c]))) 22 | (os/setenv "CFLAGS" *default-cflags*) 23 | (os/setenv "LDFLAGS" *default-ldflags*) 24 | (unpack-src ninja-src) 25 | (core/link-/bin/sh) 26 | (sh/$ cmake 27 | -Bbuild-cmake -H.) 28 | (sh/$ cmake 29 | --build build-cmake) 30 | (os/mkdir (string (dyn :pkg-out) "/bin")) 31 | # XXX: may be better to specify permissions and such explicitly? 32 | (sh/$ cp -a 33 | build-cmake/ninja 34 | (dyn :pkg-out) ^ "/bin/ninja"))) -------------------------------------------------------------------------------- /community/node.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./python3) 4 | 5 | (defsrc node-src 6 | :url 7 | "https://nodejs.org/dist/v12.18.0/node-v12.18.0.tar.gz" 8 | :hash 9 | "sha256:a55c36f0cd9898f8bfa5a793a9e656e78d383f643ebec94afa67d084620b2b13") 10 | 11 | (defpkg node 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/coreutils 17 | core/findutils 18 | core/gcc 19 | core/grep 20 | core/make 21 | python3 22 | core/sed 23 | core/which])) 24 | # 25 | (os/setenv "CFLAGS" *default-cflags*) 26 | (os/setenv "LDFLAGS" *default-ldflags*) 27 | # 28 | (unpack-src node-src) 29 | (core/link-/bin/sh) 30 | # 31 | (sh/$ python3 configure.py 32 | --prefix= ^ (dyn :pkg-out)) 33 | (sh/$ make 34 | -j (dyn :parallelism)) 35 | (sh/$ make install))) 36 | -------------------------------------------------------------------------------- /community/nomad.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./go) 4 | 5 | (defsrc nomad-src 6 | :file-name 7 | "nomad.tar.gz" 8 | :url 9 | "https://github.com/hashicorp/nomad/archive/v0.11.3.tar.gz" 10 | :hash 11 | "sha256:4ac797fd87a9e24a99e45a5dae91dd1064ab90a9da180ee2d0914a6ded4d3272") 12 | 13 | (defpkg nomad 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (string "/bin:" 18 | (join-pkg-paths ":" "/bin" 19 | [core/coreutils core/gcc go]))) 20 | (os/setenv "GOPATH" (os/cwd)) 21 | (os/setenv "GOCACHE" (string (os/cwd) "/cache")) 22 | (sh/$ mkdir -p "src/github.com/hashicorp/nomad") 23 | (os/cd "src/github.com/hashicorp/nomad") 24 | (unpack-src nomad-src) 25 | (os/setenv "CGO_ENABLED" "1") 26 | (os/mkdir (string (dyn :pkg-out) "/bin")) 27 | (sh/$ go build 28 | -trimpath 29 | -ldflags "-s -w" 30 | -tags "ui release nonvidia" 31 | -o (string (dyn :pkg-out) "/bin/nomad")))) 32 | -------------------------------------------------------------------------------- /community/openssl.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./perl) 4 | 5 | (defsrc openssl-src 6 | :url 7 | "https://www.openssl.org/source/openssl-1.1.1g.tar.gz" 8 | :hash 9 | "sha256:ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46") 10 | 11 | (defpkg openssl 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/awk core/coreutils core/gcc core/grep 17 | core/make core/sed perl])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" *default-ldflags*) 20 | (unpack-src openssl-src) 21 | (rewrite "config" 22 | |(string/replace-all "/usr/bin/env" 23 | (string (core/coreutils :path) "/bin/env") 24 | $)) 25 | (core/link-/bin/sh) 26 | # https://wiki.openssl.org/index.php/Compilation_and_Installation 27 | (sh/$ ./config 28 | (string "-Wl,-rpath=" (dyn :pkg-out) "/lib") # because of comma 29 | --prefix= ^ (dyn :pkg-out) 30 | --openssldir= ^ (dyn :pkg-out) 31 | shared) 32 | (sh/$ make -j (dyn :parallelism)) 33 | (sh/$ make install))) 34 | -------------------------------------------------------------------------------- /community/patchelf.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./autoconf) 4 | (use ./automake) 5 | (use ./m4) 6 | 7 | (defsrc patchelf-src 8 | :file-name 9 | "patchelf-0.10.tar.gz" 10 | :url 11 | "https://github.com/NixOS/patchelf/archive/0.10.tar.gz" 12 | :hash 13 | "sha256:b3cb6bdedcef5607ce34a350cf0b182eb979f8f7bc31eae55a93a70a3f020d13") 14 | 15 | (defpkg patchelf 16 | :builder 17 | (fn [] 18 | (os/setenv "PATH" 19 | (join-pkg-paths ":" "/bin" 20 | [core/awk autoconf automake core/coreutils 21 | core/gcc core/grep core/make m4 core/sed])) 22 | (os/setenv "CFLAGS" *default-cflags*) 23 | (os/setenv "LDFLAGS" *default-ldflags*) 24 | (unpack-src patchelf-src) 25 | (core/link-/bin/sh) 26 | (sh/$ ./bootstrap.sh) 27 | (sh/$ ./configure 28 | --prefix= ^ (dyn :pkg-out)) 29 | (sh/$ make 30 | PREFIX= ^ (dyn :pkg-out)) 31 | (sh/$ make 32 | PREFIX= ^ (dyn :pkg-out) 33 | install))) 34 | -------------------------------------------------------------------------------- /community/pcre.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc pcre-src 5 | :file-name 6 | "pcre-8.44.tar.bz2" 7 | :url 8 | "https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.bz2" 9 | :hash 10 | "sha256:19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d") 11 | 12 | (defpkg pcre 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk 18 | core/coreutils 19 | core/gcc 20 | core/grep 21 | core/make 22 | core/sed])) 23 | (os/setenv "CFLAGS" *default-cflags*) 24 | (os/setenv "LDFLAGS" *default-ldflags*) 25 | (unpack-src pcre-src) 26 | (core/link-/bin/sh) 27 | (sh/$ ./configure 28 | --prefix= ^ (dyn :pkg-out)) 29 | (sh/$ make 30 | -j (dyn :parallelism)) 31 | (sh/$ make 32 | install))) 33 | -------------------------------------------------------------------------------- /community/pcre2.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc pcre2-src 5 | :file-name 6 | "pcre2-10.35.tar.gz" 7 | :url 8 | "https://ftp.pcre.org/pub/pcre/pcre2-10.35.tar.gz" 9 | :hash 10 | "sha256:8fdcef8c8f4cd735169dd0225fd010487970c1bcadd49e9b90e26c7250a33dc9") 11 | 12 | (defpkg pcre2 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk 18 | core/coreutils 19 | core/gcc 20 | core/grep 21 | core/make 22 | core/sed])) 23 | (os/setenv "CFLAGS" *default-cflags*) 24 | (os/setenv "LDFLAGS" *default-ldflags*) 25 | (unpack-src pcre2-src) 26 | (core/link-/bin/sh) 27 | (sh/$ ./configure 28 | --prefix= ^ (dyn :pkg-out)) 29 | (sh/$ make 30 | -j (dyn :parallelism)) 31 | (sh/$ make 32 | install))) 33 | -------------------------------------------------------------------------------- /community/peg.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc peg-src 5 | :url 6 | "https://www.piumarta.com/software/peg/peg-0.1.18.tar.gz" 7 | :hash 8 | "sha256:20193bdd673fc7487a38937e297fff08aa73751b633a086ac28c3b34890f9084") 9 | 10 | (defpkg peg 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/make])) 16 | (unpack-src peg-src) 17 | (core/link-/bin/sh) 18 | (sh/$ make 19 | CFLAGS= ^ (string *default-cflags* " --static") 20 | PREFIX= ^ (dyn :pkg-out) 21 | install))) 22 | -------------------------------------------------------------------------------- /community/perl.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc perl-src 5 | :url 6 | "https://www.cpan.org/src/5.0/perl-5.30.2.tar.gz" 7 | :hash 8 | "sha256:66db7df8a91979eb576fac91743644da878244cf8ee152f02cd6f5cd7a731689") 9 | 10 | (defpkg perl 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (string "/bin:" 15 | (join-pkg-paths ":" "/bin" 16 | [core/awk core/coreutils core/dash 17 | core/gcc core/grep core/make 18 | core/sed]))) 19 | (os/setenv "CFLAGS" *default-cflags*) 20 | (os/setenv "LDFLAGS" *default-ldflags*) 21 | (unpack-src perl-src) 22 | # patching path to pwd 23 | (os/chmod "dist/PathTools/Cwd.pm" 8r644) 24 | (rewrite "dist/PathTools/Cwd.pm" 25 | |(string/replace-all "'/bin/pwd'" 26 | (string "'" 27 | (core/coreutils :path) "/bin/pwd" 28 | "'") 29 | $)) 30 | (os/chmod "dist/PathTools/Cwd.pm" 8r444) 31 | # other assumed bits 32 | (core/link-/bin/sh) 33 | (sh/$ ./configure.gnu 34 | -Dprefix= ^ (dyn :pkg-out) 35 | -Dcc=gcc) 36 | (sh/$ make -j (dyn :parallelism)) 37 | (sh/$ make install))) 38 | -------------------------------------------------------------------------------- /community/proot.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./talloc) 4 | (use ./uthash) 5 | 6 | (defsrc proot-src 7 | :file-name 8 | "proot-a6db8746f21a2e68a8d0290a0aa9b3ad36d78f56.tar.gz" 9 | :url 10 | "https://github.com/proot-me/PRoot/archive/a6db8746f21a2e68a8d0290a0aa9b3ad36d78f56.tar.gz" 11 | :hash 12 | "sha256:410d63520cb1aaad8370362f3f8a5f77fd5a7a13093fda4a9d4b45ff2ac36b28") 13 | 14 | (defsrc sys-queue.h-src 15 | :file-name "queue.h" 16 | :url 17 | "https://git.alpinelinux.org/aports/plain/main/libc-dev/sys-queue.h?h=3.11-stable" 18 | :hash 19 | "sha256:c13407edd0e33be73cae72514cb234f8612e1c0e54401c9448daffd3a240158b") 20 | 21 | (defpkg proot 22 | :builder 23 | (fn [] 24 | (os/setenv "PATH" 25 | (string "/bin:" 26 | (join-pkg-paths ":" "/bin" 27 | [core/awk core/coreutils core/grep 28 | core/gcc core/make]))) 29 | (os/setenv "CFLAGS" 30 | (string *default-cflags* 31 | " " 32 | "-I" "/build/include" 33 | " " 34 | "-I" (talloc :path) "/include" 35 | " " 36 | "-I" (uthash :path) "/include")) 37 | (os/setenv "LDFLAGS" 38 | (string *default-ldflags* 39 | " " 40 | "-L" (talloc :path) "/lib" 41 | " " 42 | "-Wl,-rpath," (talloc :path) "/lib")) 43 | (unpack-src proot-src) 44 | # XXX: doing this before unpack seems to be problematic? 45 | (os/mkdir "/build/include") 46 | (os/mkdir "/build/include/sys") 47 | (sh/$ cp (sys-queue.h-src :path) ^ "/queue.h" 48 | "/build/include/sys") 49 | (core/link-/bin/sh) 50 | (os/cd "src") 51 | (sh/$ make 52 | PREFIX= ^ (dyn :pkg-out)) 53 | (sh/$ make 54 | PREFIX= ^ (dyn :pkg-out) 55 | install))) 56 | -------------------------------------------------------------------------------- /community/python3.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./libffi) 4 | (use ./openssl) 5 | (use ./zlib) 6 | 7 | (defsrc python3-src 8 | :url 9 | "https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz" 10 | :hash 11 | "sha256:6af6d4d2e010f9655518d0fc6738c7ff7069f10a4d2fbd55509e467f092a8b90") 12 | 13 | # https://bugs.python.org/issue14527#msg368413 14 | # https://bugs.python.org/issue31710#msg348109 15 | # https://bugs.python.org/issue31710#msg303801 16 | (defpkg python3 17 | :builder 18 | (fn [] 19 | (os/setenv "PATH" 20 | (join-pkg-paths ":" "/bin" 21 | [core/awk core/coreutils core/gcc core/grep 22 | core/make core/pkgconf core/sed])) 23 | (os/setenv "PKG_CONFIG_PATH" 24 | (join-pkg-paths ":" "/lib/pkgconfig" 25 | [libffi openssl zlib])) 26 | (os/setenv "CFLAGS" 27 | (string 28 | *default-cflags* 29 | " " 30 | "-fPIC" # XXX: talloc wanted this, but may be good in general? 31 | " " 32 | # XXX: see hermes 1 and https://bugs.python.org/issue32307 33 | "-DTHREAD_STACK_SIZE=0x100000" 34 | " " 35 | (sh/$<_ pkg-config --cflags 36 | libffi libcrypto libssl zlib))) 37 | # XXX: setup.py doesn't use CFLAGS, but instead CPPFLAGS 38 | (os/setenv "CPPFLAGS" 39 | (os/getenv "CFLAGS")) 40 | (os/setenv "LDFLAGS" 41 | (string 42 | *default-ldflags* 43 | " " 44 | (sh/$<_ pkg-config --libs 45 | libffi libcrypto libssl zlib) 46 | " " 47 | "-Wl,-rpath=" (join-pkg-paths ":" "/lib" 48 | [libffi openssl zlib]))) 49 | (os/setenv "LD_LIBRARY_PATH" 50 | (join-pkg-paths ":" "/lib" 51 | [libffi openssl zlib])) 52 | (unpack-src python3-src) 53 | (core/link-/bin/sh) 54 | (sh/$ ./configure 55 | --with-openssl= ^ (openssl :path) 56 | --prefix= ^ (dyn :pkg-out)) 57 | (sh/$ make 58 | PREFIX= ^ (dyn :pkg-out) 59 | -j (dyn :parallelism)) 60 | (sh/$ make 61 | PREFIX= ^ (dyn :pkg-out) 62 | install))) 63 | -------------------------------------------------------------------------------- /community/quickjs.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc quickjs-src 5 | :url 6 | "https://bellard.org/quickjs/quickjs-2020-04-12.tar.xz" 7 | :hash 8 | "sha256:22b15f2cc910289821379dc8d314d35ef492f6d69d4419c9bcb1b2263e9d71c8") 9 | 10 | (defpkg quickjs 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/make])) 16 | (core/link-/bin/sh) 17 | (unpack-src quickjs-src) 18 | (rewrite "Makefile" 19 | |(->> $ 20 | (string/replace "prefix=/usr/local" (string "prefix=" (dyn :pkg-out))) 21 | (string/replace "AR=$(CROSS_PREFIX)gcc-ar" "AR=ar"))) 22 | (sh/$ make install -j (dyn :parallelism)))) 23 | -------------------------------------------------------------------------------- /community/radare2.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./capstone) 4 | (use ./file) 5 | (use ./xxhash) 6 | (use ./zlib) 7 | (use ./libzip) 8 | (use ./lz4) 9 | (use ./openssl) 10 | (use ./libuv) 11 | 12 | # XXX tree-sitter can be used to enable features. 13 | 14 | (defsrc radare2-src 15 | :file-name 16 | "radare2-4.4.0.tar.gz" 17 | :url 18 | "https://github.com/radareorg/radare2/archive/4.4.0.tar.gz" 19 | :hash 20 | "sha256:401ab89f39f7e70e03336f6890dc4fdf52dae4f61201e4cd8a1fbe5a4b9eb451") 21 | 22 | (defpkg radare2 23 | :builder 24 | (fn [] 25 | (os/setenv "PKG_CONFIG_PATH" 26 | (string 27 | (join-pkg-paths ":" "/lib64/pkgconfig" 28 | [libuv libzip]) 29 | ":" 30 | (join-pkg-paths ":" "/lib/pkgconfig" 31 | [capstone zlib openssl xxhash lz4]))) 32 | 33 | (os/setenv "PATH" 34 | (join-pkg-paths ":" "/bin" 35 | [core/coreutils 36 | core/findutils 37 | core/gcc 38 | core/grep 39 | core/make 40 | core/patch 41 | core/sed 42 | core/awk 43 | core/tar 44 | core/pkgconf])) 45 | (core/link-/bin/sh) 46 | (unpack-src radare2-src) 47 | 48 | (os/setenv "CFLAGS" 49 | (string *default-cflags* 50 | " " 51 | (string "-I" (file :path) "/include") 52 | " " 53 | # capstone does this weird thing that there is a `capstone` directory in the 54 | # include/ directory, the the .pc points to this, whereas radare2 55 | # #includes , thus we need to add this -I so that radare2 56 | # finds the header files. 57 | (string "-I" (capstone :path) "/include") 58 | " " 59 | (sh/$<_ pkg-config --cflags capstone liblz4 zlib libuv libxxhash libssl libcrypto))) 60 | (os/setenv "LDFLAGS" 61 | (string *default-ldflags* 62 | " " 63 | "-Wl,--enable-new-dtags" 64 | " " 65 | "-lmagic" 66 | " " 67 | (string "-L" (file :path) "/lib") 68 | " " 69 | "-Wl,-rpath=" (string 70 | (dyn :pkg-out) "/lib" # to find own libs 71 | ":" 72 | (join-pkg-paths ":" "/lib" 73 | [capstone file zlib lz4 xxhash openssl]) 74 | ":" 75 | (join-pkg-paths ":" "/lib64" 76 | [libuv libzip])) 77 | " " 78 | (sh/$<_ pkg-config --libs capstone zlib liblz4 libxxhash libssl libcrypto libuv libzip))) 79 | 80 | (sh/$ ./configure 81 | --prefix= ^ (dyn :pkg-out) 82 | --with-syscapstone 83 | --with-sysxxhash 84 | --with-syszip 85 | --with-sysmagic 86 | --with-openssl) 87 | 88 | (sh/$ make 89 | -j (dyn :parallelism)) 90 | 91 | (sh/$ make 92 | install))) 93 | -------------------------------------------------------------------------------- /community/re2c.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc re2c-src 5 | :url 6 | "https://github.com/skvadrik/re2c/releases/download/1.3/re2c-1.3.tar.xz" 7 | :hash 8 | "sha256:f37f25ff760e90088e7d03d1232002c2c2672646d5844fdf8e0d51a5cd75a503") 9 | 10 | (defpkg re2c 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk 16 | core/coreutils 17 | core/diffutils 18 | core/gcc 19 | core/grep 20 | core/make 21 | core/sed])) 22 | (os/setenv "CFLAGS" *default-cflags*) 23 | (os/setenv "LDFLAGS" *default-ldflags*) 24 | (unpack-src re2c-src) 25 | (core/link-/bin/sh) 26 | (sh/$ ./configure 27 | --prefix= ^ (dyn :pkg-out)) 28 | (sh/$ make 29 | -j (dyn :parallelism)) 30 | (sh/$ make install))) 31 | -------------------------------------------------------------------------------- /community/readline.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | (use ./patchelf) 5 | 6 | (defsrc readline-src 7 | :url 8 | "https://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz" 9 | :hash 10 | "sha256:e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461") 11 | 12 | (defpkg readline 13 | :builder 14 | (fn [] 15 | (os/setenv "PKG_CONFIG_PATH" 16 | (string (ncurses :path) "/lib/pkgconfig")) 17 | (os/setenv "PATH" 18 | (join-pkg-paths ":" "/bin" 19 | [core/awk core/coreutils core/gcc 20 | core/grep core/make patchelf 21 | core/pkgconf core/sed])) 22 | (os/setenv "CFLAGS" 23 | (string 24 | *default-cflags* 25 | " " 26 | "-I" (ncurses :path) "/include")) 27 | (os/setenv "LDFLAGS" 28 | (string 29 | *default-ldflags* 30 | " " 31 | "-L" (ncurses :path) "/lib")) 32 | (unpack-src readline-src) 33 | (core/link-/bin/sh) 34 | (sh/$ ./configure 35 | --prefix= ^ (dyn :pkg-out) 36 | --with-curses 37 | ) 38 | (sh/$ make 39 | # see INSTALL file 40 | SHLIB_LIBS= ^ -lncurses 41 | -j (dyn :parallelism)) 42 | (sh/$ make install) 43 | # 44 | (sh/$ patchelf --set-rpath 45 | (ncurses :path) ^ "/lib" 46 | (dyn :pkg-out) ^ "/lib/libreadline.so.8") 47 | (sh/$ patchelf --set-rpath 48 | (ncurses :path) ^ "/lib" 49 | (dyn :pkg-out) ^ "/lib/libhistory.so.8") 50 | # XXX: leaving .pc files alone for the moment 51 | )) 52 | -------------------------------------------------------------------------------- /community/rlwrap.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | (use ./patchelf) 5 | (use ./readline) 6 | 7 | (defsrc rlwrap-src 8 | :url 9 | "https://github.com/hanslub42/rlwrap/releases/download/v0.43/rlwrap-0.43.tar.gz" 10 | :hash 11 | "sha256:8e86d0b7882d9b8a73d229897a90edc207b1ae7fa0899dca8ee01c31a93feb2f") 12 | 13 | (defpkg rlwrap 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" 17 | (join-pkg-paths ":" "/bin" 18 | [core/awk 19 | core/coreutils 20 | core/gcc 21 | core/grep 22 | core/make 23 | patchelf 24 | core/sed 25 | ])) 26 | (os/setenv "CPPFLAGS" 27 | (string 28 | "-I" (ncurses :path) "/include" 29 | " " 30 | "-I" (readline :path) "/include")) 31 | (os/setenv "CFLAGS" *default-cflags*) 32 | (os/setenv "LDFLAGS" 33 | (string 34 | *default-ldflags* 35 | " " 36 | "-L" (ncurses :path) "/lib" 37 | " " 38 | "-L" (readline :path) "/lib")) 39 | # placate configure 40 | (os/setenv "LD_LIBRARY_PATH" 41 | (join-pkg-paths ":" "/lib" 42 | [ncurses readline])) 43 | # 44 | (unpack-src rlwrap-src) 45 | (core/link-/bin/sh) 46 | # 47 | (sh/$ ./configure 48 | --prefix= ^ (dyn :pkg-out)) 49 | (sh/$ make 50 | -j (dyn :parallelism)) 51 | (sh/$ make install) 52 | # 53 | (sh/$ patchelf --set-rpath 54 | (join-pkg-paths ":" "/lib" [ncurses readline]) 55 | (dyn :pkg-out) ^ "/bin/rlwrap") 56 | # XXX things in share/rlwrap/filters may start with: 57 | # #! /usr/bin/env 58 | # #! /usr/bin/python3 59 | )) 60 | -------------------------------------------------------------------------------- /community/rust.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (use ./patchelf) 3 | (use ./cmake) 4 | (use ./ninja) 5 | (use ./openssl) 6 | (use ./patchelf) 7 | (use ./python3) 8 | 9 | (import ../core) 10 | 11 | 12 | # https://forge.rust-lang.org/infra/other-installation-methods.html 13 | (defsrc rust-bootstrap-src 14 | :url 15 | "https://static.rust-lang.org/dist/rust-1.45.2-x86_64-unknown-linux-musl.tar.gz" 16 | :hash 17 | "sha256:1518bc5255c248a62a58562368e0a54f61fe02fd50f97f68882a65a62b100c17") 18 | 19 | (defpkg rust-bootstrap 20 | :builder 21 | (fn [] 22 | (os/setenv "PATH" 23 | (string "/bin" 24 | ":" 25 | (join-pkg-paths ":" "/bin" 26 | [core/coreutils 27 | core/grep 28 | core/make 29 | core/sed 30 | patchelf]))) 31 | (os/setenv "CFLAGS" *default-cflags*) 32 | (os/setenv "LDFLAGS" *default-ldflags*) 33 | (unpack-src rust-bootstrap-src) 34 | (core/link-/bin/sh) 35 | (sh/$ sh install.sh 36 | --disable-ldconfig 37 | --prefix= ^ (dyn :pkg-out) 38 | --components= ^ "rustc,cargo,rust-std-x86_64-unknown-linux-musl") 39 | # necessary to set INTERPRETER 40 | (def exe-paths 41 | (map |(string (dyn :pkg-out) "/bin/" $) 42 | ["cargo" 43 | "rustc" 44 | "rustdoc"])) 45 | (each path exe-paths 46 | (sh/$ patchelf 47 | --set-interpreter 48 | (string (core/gcc-rt :path) 49 | "/x86_64-linux-musl/lib/ld-musl-x86_64.so.1") 50 | ,path)))) 51 | 52 | (defsrc rust-src 53 | :url 54 | "https://static.rust-lang.org/dist/rustc-1.45.2-src.tar.gz" 55 | :hash 56 | "sha256:b7a3fc1e3ee367260ef945da867da0957f8983705f011ba2a73715375e50e308") 57 | 58 | (def- rust-build-config `` 59 | [llvm] 60 | 61 | static-libstdcpp = true 62 | ninja = true 63 | 64 | [build] 65 | 66 | build = "x86_64-unknown-linux-musl" 67 | cargo = "{{BOOTSTRAP_RUST}}/bin/cargo" 68 | rustc = "{{BOOTSTRAP_RUST}}/bin/rustc" 69 | docs = false 70 | submodules = false 71 | extended = true 72 | vendor = true 73 | verbose = 2 74 | print-step-timings = true 75 | 76 | [install] 77 | 78 | prefix = "{{OUT}}" 79 | # XXX: installer doesn't respect prefix 80 | sysconfdir = "{{OUT}}/etc" 81 | 82 | [rust] 83 | 84 | # XXX: lld = true seems to lead to lld being built 85 | lld = false 86 | default-linker = "{{GCC}}/bin/gcc" 87 | channel = "stable" 88 | verbose-tests = true 89 | codegen-backends = ["llvm"] 90 | # XXX: rpath = true leads to RPATH value of $ORIGIN/../lib 91 | rpath = false 92 | 93 | [target.x86_64-unknown-linux-musl] 94 | 95 | cc = "{{GCC}}/bin/gcc" 96 | cxx = "{{GCC}}/bin/g++" 97 | ar = "{{GCC}}/bin/ar" 98 | ranlib = "{{GCC}}/bin/ranlib" 99 | linker = "{{GCC}}/bin/gcc" 100 | crt-static = false 101 | musl-root = "{{GCC}}/x86_64-linux-musl" 102 | 103 | [dist] 104 | ``) 105 | 106 | (defpkg rust 107 | :builder 108 | (fn [] 109 | (os/setenv "PKG_CONFIG_PATH" 110 | (string (openssl :path) "/lib/pkgconfig")) 111 | (os/setenv "PATH" 112 | (string "/bin" # for /bin/sh (needed for install.sh) 113 | ":" 114 | (join-pkg-paths ":" "/bin" 115 | [cmake 116 | core/coreutils 117 | core/gcc 118 | core/grep # needed to run install.sh 119 | ninja 120 | python3 121 | patchelf 122 | core/pkgconf # needed for openssl-sys crate(?) 123 | rust-bootstrap 124 | core/sed # needed to run install.sh 125 | ]))) 126 | (os/setenv "CFLAGS" *default-cflags*) 127 | (os/setenv "LDFLAGS" *default-ldflags*) 128 | (unpack-src rust-src) 129 | (core/link-/bin/sh) 130 | 131 | (spit "config.toml" 132 | (->> rust-build-config 133 | (string/replace-all "{{BOOTSTRAP_RUST}}" (rust-bootstrap :path)) 134 | (string/replace-all "{{GCC}}" (core/gcc :path)) 135 | (string/replace-all "{{OUT}}" (dyn :pkg-out)))) 136 | 137 | (os/setenv "RUST_BACKTRACE" "1") 138 | (os/setenv "OPENSSL_STATIC" "1") 139 | (sh/$ python3 x.py install) 140 | # RUNPATH adjustment 141 | (def exes 142 | (map |(string (dyn :pkg-out) "/bin/" $) 143 | ["clippy-driver" 144 | "rls" 145 | "rustc" 146 | "rustdoc"])) 147 | (def libs 148 | [;(sh/glob (string (dyn :pkg-out) "/lib/librustc_driver-*.so")) 149 | ;(sh/glob (string (dyn :pkg-out) "/lib/libtest-*.so"))]) 150 | (def runpath 151 | (string (dyn :pkg-out) "/lib")) 152 | (each bin-path (array/concat exes libs) 153 | (sh/$ patchelf 154 | --set-rpath ,runpath 155 | ,bin-path)) 156 | (sh/$ patchelf 157 | --set-rpath (string (dyn :pkg-out) 158 | "/lib/rustlib/x86_64-unknown-linux-musl/lib") 159 | ;(sh/glob (string (dyn :pkg-out) 160 | "/lib/rustlib/x86_64-unknown-linux-musl/lib" 161 | "/libtest-*.so"))))) 162 | -------------------------------------------------------------------------------- /community/rwpart.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./patchelf) 4 | (use ./util-linux) 5 | 6 | (defsrc rwpart-src 7 | :file-name 8 | "rwpart-0.0.2.tar.gz" 9 | :url 10 | "https://github.com/andrewchambers/rwpart/archive/v0.0.2.tar.gz" 11 | :hash 12 | "sha256:6f9859a0197d5982f74acc7643b82e8c4840e336ad866470bcaab4b301b87649") 13 | 14 | (defpkg rwpart 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (join-pkg-paths ":" "/bin" 19 | [core/coreutils 20 | core/gcc 21 | core/make 22 | patchelf])) 23 | (os/setenv "CPPFLAGS" 24 | (string "-I" (util-linux :path) "/include")) 25 | (os/setenv "CFLAGS" *default-cflags*) 26 | (os/setenv "LDFLAGS" 27 | (string *default-ldflags* 28 | " " 29 | "-L" (util-linux :path) "/lib")) 30 | (os/setenv "LDLIBS" 31 | (string "-l uuid" 32 | " " 33 | "-l blkid")) 34 | (os/setenv "CC" "gcc") 35 | # 36 | (unpack-src rwpart-src) 37 | (rewrite "Makefile" 38 | |(string/replace "LDFLAGS=" 39 | "LDFLAGS+=" 40 | $)) 41 | (rewrite "Makefile" 42 | |(string/replace "LDLIBS=" 43 | "LDLIBS+=" 44 | $)) 45 | (core/link-/bin/sh) 46 | # 47 | (sh/$ make 48 | PREFIX= ^ (dyn :pkg-out) 49 | -j (dyn :parallelism)) 50 | (sh/$ make 51 | PREFIX= ^ (dyn :pkg-out) 52 | install) 53 | # 54 | (each exe ["rwpart-offset" "rwpart-read" "rwpart-size" "rwpart-write"] 55 | (sh/$ patchelf --set-rpath 56 | (join-pkg-paths ":" "/lib" 57 | [util-linux]) 58 | (string (dyn :pkg-out) "/bin/" exe))))) 59 | -------------------------------------------------------------------------------- /community/samurai.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc samurai-src 5 | :file-name 6 | "samurai-1.1.tar.gz" 7 | :url 8 | "https://github.com/michaelforney/samurai/archive/1.1.tar.gz" 9 | :hash 10 | "sha256:9f31e45e65c0b270c0dae431460c53bc0a254dc98385947e3ab507b7b986a162") 11 | 12 | (defpkg samurai 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (string "/bin:" 17 | (join-pkg-paths ":" "/bin" 18 | [core/coreutils core/gcc core/make]))) 19 | # needed to find correct c99 wrapper(?) 20 | (os/setenv "CC" "gcc") 21 | (os/setenv "CFLAGS" *default-cflags*) 22 | (os/setenv "LDFLAGS" *default-ldflags*) 23 | (unpack-src samurai-src) 24 | (core/link-/bin/sh) 25 | (sh/$ make samu 26 | -j (dyn :parallelism)) 27 | (sh/$ make 28 | PREFIX= ^ (dyn :pkg-out) 29 | install))) 30 | -------------------------------------------------------------------------------- /community/scdoc.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc scdoc-src 5 | :url 6 | "https://git.sr.ht/~sircmpwn/scdoc/refs/1.10.1/scdoc-1.10.1.tar.gz" 7 | :hash 8 | "sha256:51b60a2e9c51c3160f24f88bed8ba68d2357b5a1bc0e34b7a2ff83245f132333") 9 | 10 | (defpkg scdoc 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/sed core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 18 | (core/link-/bin/sh) 19 | (unpack-src scdoc-src) 20 | (sh/$ make 21 | PREFIX= ^ (dyn :pkg-out) 22 | install))) 23 | -------------------------------------------------------------------------------- /community/sqlite3.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc sqlite3-src 5 | :url 6 | "https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz" 7 | :hash 8 | "sha256:62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae") 9 | 10 | (defpkg sqlite3 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/gcc 16 | core/grep core/make core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src sqlite3-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make 24 | -j (dyn :parallelism)) 25 | (sh/$ make install))) 26 | -------------------------------------------------------------------------------- /community/squashfs-tools.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (use ../core) 3 | (use ./zlib) 4 | 5 | (defsrc squashfs-tools-src 6 | :file-name 7 | "squashfs-tools.tar.gz" 8 | :url 9 | "https://github.com/plougher/squashfs-tools/archive/4.4.tar.gz" 10 | :hash 11 | "sha256:a7fa4845e9908523c38d4acf92f8a41fdfcd19def41bd5090d7ad767a6dc75c3") 12 | 13 | (defpkg squashfs-tools 14 | :builder 15 | (fn [] 16 | (os/setenv "PATH" (pkg-path "/bin" build-env)) 17 | (unpack-src squashfs-tools-src) 18 | (os/cd "squashfs-tools") 19 | (sh/$ make install 20 | -j (dyn :parallelism) 21 | INSTALL_DIR= ^ (dyn :pkg-out) ^ "/bin" 22 | EXTRA_CFLAGS= ^ (string "-I" (pkg-path "/include" zlib)) 23 | EXTRA_LDFLAGS= ^ (string "--static -L" (pkg-path "/lib" zlib))))) 24 | -------------------------------------------------------------------------------- /community/syslinux.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./nasm) 4 | (use ./perl) 5 | (use ./upx) 6 | (use ./util-linux) 7 | 8 | (defsrc syslinux-src 9 | :url 10 | "https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/6.xx/syslinux-6.03.tar.xz" 11 | :hash 12 | "sha256:26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e") 13 | 14 | (defpkg gcc-wrapper 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (join-pkg-paths ":" "/bin" 19 | [core/coreutils])) 20 | (sh/$ mkdir (dyn :pkg-out) ^ /bin) 21 | (def wrapper-path (string (dyn :pkg-out) "/bin/gcc")) 22 | (spit wrapper-path 23 | (string 24 | "#! /bin/sh\n" 25 | "set -eux\n" 26 | "exec " (core/gcc :path) "/bin/gcc" 27 | " -L" (pkg-path "/lib" util-linux) 28 | " -I" (pkg-path "/include" util-linux) 29 | " \"$@\"\n")) 30 | (sh/$ chmod +x ,wrapper-path))) 31 | 32 | (defpkg syslinux 33 | :builder 34 | (fn [] 35 | (os/setenv "PATH" 36 | (join-pkg-paths ":" "/bin" 37 | [core/awk 38 | core/coreutils 39 | core/findutils 40 | # XXX: order matters here 41 | gcc-wrapper 42 | core/gcc 43 | core/grep 44 | core/gzip 45 | core/make 46 | nasm 47 | perl 48 | core/sed 49 | upx])) 50 | # https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/syslinux#n84-n85 51 | (os/setenv "LDFLAGS" 52 | (string *default-ldflags* " " "--no-dynamic-linker")) 53 | (os/setenv "EXTRA_CFLAGS" "-fno-PIE") 54 | # 55 | (unpack-src syslinux-src) 56 | # https://github.com/buildroot/buildroot/blob/master/boot/syslinux/0012-pull-in-sys-sysmacros-h-for-major-minor-makedev.patch 57 | # https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch?id=19ae69e682d94b2317057e4751e4b78555868362 58 | # XXX: this may not be necessary at some point 59 | (rewrite "extlinux/main.c" 60 | |(string/replace (string "#include \n" 61 | "#include \n") 62 | (string "#include \n" 63 | "#include \n" 64 | "#include \n") 65 | $)) 66 | (core/link-/bin/sh) 67 | (unless (os/lstat "/bin/pwd") 68 | (os/symlink (pkg-path "/bin/pwd" core/coreutils) "/bin/pwd")) 69 | (unless (os/lstat "/bin/echo") 70 | (os/symlink (pkg-path "/bin/echo" core/coreutils) "/bin/echo")) 71 | # 72 | (sh/$ make 73 | BINDIR=/bin 74 | SBINDIR=/sbin 75 | MANDIR=/share/man 76 | DATADIR=/share 77 | INSTALLROOT= ^ (dyn :pkg-out) 78 | -j (dyn :parallelism) 79 | install))) 80 | -------------------------------------------------------------------------------- /community/talloc.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./python3) 4 | 5 | (defsrc talloc-src 6 | :url 7 | "https://www.samba.org/ftp/talloc/talloc-2.3.1.tar.gz" 8 | :hash 9 | "sha256:ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77") 10 | 11 | (defpkg talloc 12 | :builder 13 | (fn [] 14 | (os/setenv "PATH" 15 | (join-pkg-paths ":" "/bin" 16 | [core/coreutils core/gcc core/make python3 17 | core/sed core/which])) 18 | (os/setenv "CFLAGS" *default-cflags*) 19 | (os/setenv "LDFLAGS" *default-ldflags*) 20 | (unpack-src talloc-src) 21 | (core/link-/bin/sh) 22 | # XXX: waf is a python script starting with /usr/bin/env 23 | (unless (os/lstat "/usr/bin/env") 24 | (os/symlink (string (core/coreutils :path) "/bin/env") 25 | "/usr/bin/env")) 26 | (sh/$ ./configure 27 | --prefix= ^ (dyn :pkg-out)) 28 | (sh/$ make 29 | PREFIX= ^ (dyn :pkg-out) 30 | -j (dyn :parallelism)) 31 | (sh/$ make 32 | PREFIX= ^ (dyn :pkg-out) 33 | install))) 34 | -------------------------------------------------------------------------------- /community/texinfo.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | (use ./perl) 5 | 6 | (defsrc texinfo-src 7 | :url 8 | "https://ftp.gnu.org/gnu/texinfo/texinfo-6.7.tar.xz" 9 | :hash 10 | "sha256:988403c1542d15ad044600b909997ba3079b10e03224c61188117f3676b02caa") 11 | 12 | (defpkg texinfo 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/awk core/coreutils core/diffutils 18 | core/gcc core/grep core/make core/pkgconf 19 | perl core/sed])) 20 | (os/setenv "PKG_CONFIG_PATH" 21 | (string (ncurses :path) "/lib/pkgconfig")) 22 | (os/setenv "CFLAGS" 23 | (string 24 | *default-cflags* 25 | " " 26 | "-fPIC" # XXX: add to defaults? 27 | " " 28 | (sh/$<_ pkg-config --cflags ncurses))) 29 | (os/setenv "LDFLAGS" 30 | (string 31 | *default-ldflags* 32 | " " 33 | (sh/$<_ pkg-config --libs ncurses))) 34 | # placate configure 35 | (os/setenv "LD_LIBRARY_PATH" 36 | (string (ncurses :path) "/lib")) 37 | (unpack-src texinfo-src) 38 | (core/link-/bin/sh) 39 | (sh/$ ./configure 40 | --prefix= ^ (dyn :pkg-out)) 41 | (sh/$ make 42 | -j (dyn :parallelism)) 43 | (sh/$ make install))) 44 | -------------------------------------------------------------------------------- /community/tmux.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./libevent) 4 | (use ./ncurses) 5 | (use ./patchelf) 6 | 7 | (defsrc tmux-src 8 | :url 9 | "https://github.com/tmux/tmux/releases/download/3.1b/tmux-3.1b.tar.gz" 10 | :hash 11 | "sha256:d93f351d50af05a75fe6681085670c786d9504a5da2608e481c47cf5e1486db9") 12 | 13 | (defpkg tmux 14 | :builder 15 | (fn [] 16 | (os/setenv "PKG_CONFIG_PATH" 17 | (join-pkg-paths ":" "/lib/pkgconfig" [libevent ncurses])) 18 | (os/setenv "PATH" 19 | (join-pkg-paths ":" "/bin" 20 | [core/awk core/coreutils core/gcc 21 | core/grep core/make patchelf 22 | core/pkgconf core/sed])) 23 | (os/setenv "CFLAGS" 24 | (string *default-cflags* 25 | " " 26 | (sh/$<_ pkg-config --cflags libevent ncurses))) 27 | (os/setenv "LDFLAGS" 28 | (string *default-ldflags* 29 | " " 30 | (sh/$<_ pkg-config --libs libevent ncurses))) 31 | # placate configure 32 | (os/setenv "LD_LIBRARY_PATH" 33 | (join-pkg-paths ":" "/lib" [libevent ncurses])) 34 | (unpack-src tmux-src) 35 | (core/link-/bin/sh) 36 | (sh/$ ./configure 37 | --prefix= ^ (dyn :pkg-out)) 38 | (sh/$ make 39 | -j (dyn :parallelism)) 40 | (sh/$ make install) 41 | (sh/$ patchelf --set-rpath 42 | (join-pkg-paths ":" "/lib" [libevent ncurses]) 43 | (dyn :pkg-out) ^ "/bin/tmux"))) 44 | -------------------------------------------------------------------------------- /community/upx.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./file) 4 | (use ./patchelf) 5 | (use ./perl) 6 | (use ./zlib) 7 | 8 | (defsrc ucl-src 9 | :url 10 | "http://www.oberhumer.com/opensource/ucl/download/ucl-1.03.tar.gz" 11 | :hash 12 | "sha256:b865299ffd45d73412293369c9754b07637680e5c826915f097577cd27350348") 13 | 14 | (defpkg ucl 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (join-pkg-paths ":" "/bin:/usr/bin" 19 | [core/awk 20 | core/coreutils 21 | file 22 | core/gcc 23 | core/grep 24 | core/make 25 | core/sed])) 26 | # https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/syslinux#n84-n85 27 | (os/setenv "LDFLAGS" *default-ldflags*) 28 | # XXX: possibly an alternative to setting CPPFLAGS is: 29 | # https://git.alpinelinux.org/aports/tree/community/ucl/0001-Static-assert.patch 30 | # https://bugs.archlinux.org/task/49287 31 | (os/setenv "CPPFLAGS" "-std=c90 -fPIC") 32 | # 33 | (unpack-src ucl-src) 34 | (core/link-/bin/sh) 35 | (unless (os/lstat "/usr/bin/file") 36 | (os/symlink (pkg-path "/bin/file" file) "/usr/bin/file")) 37 | # 38 | (sh/$ ./configure 39 | --prefix= ^ (dyn :pkg-out) 40 | --enable-shared 41 | --enable-static 42 | ) 43 | (sh/$ make 44 | PREFIX= ^ (dyn :pkg-out) 45 | -j (dyn :parallelism)) 46 | (sh/$ make 47 | PREFIX= ^ (dyn :pkg-out) 48 | install))) 49 | 50 | (defsrc upx-lzma-sdk 51 | :url 52 | "https://github.com/upx/upx-lzma-sdk/archive/v3.96.tar.gz" 53 | :hash 54 | "sha256:e465670abe0900a0995f7e6166bff86caed06b253f6ff02d6490df6263aecc67") 55 | 56 | (defsrc upx-src 57 | :url 58 | "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-src.tar.xz" 59 | :hash 60 | "sha256:47774df5c958f2868ef550fb258b97c73272cb1f44fe776b798e393465993714") 61 | 62 | (defpkg upx 63 | :builder 64 | (fn [] 65 | (os/setenv "PATH" 66 | (join-pkg-paths ":" "/bin" 67 | [core/coreutils 68 | core/gcc 69 | core/make 70 | patchelf 71 | perl 72 | core/sed])) 73 | (os/setenv "CPPFLAGS" 74 | (string "-I" (ucl :path) "/include" 75 | " " 76 | "-I" (zlib :path) "/include")) 77 | (os/setenv "LDFLAGS" 78 | (string *default-ldflags* 79 | " " 80 | "-L" 81 | (ucl :path) "/lib" 82 | " " 83 | "-L" 84 | (zlib :path) "/lib")) 85 | # 86 | (unpack-src upx-src) 87 | (unpack-src upx-lzma-sdk) 88 | # 89 | (core/link-/bin/sh) 90 | # 91 | (sh/$ make 92 | # https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx#n28 93 | CHECK_WHITESPACE= ^ (core/coreutils :path) ^ "/bin/true" 94 | UPX_LZMADIR= ^ (first (sh/glob "upx-lzma-sdk-*")) 95 | -j (dyn :parallelism) 96 | all) 97 | (sh/$ install -Dm755 98 | src/upx.out (dyn :pkg-out) ^ "/bin/upx") 99 | (sh/$ install -Dm644 100 | doc/upx.1 (dyn :pkg-out) ^ "/man/man1/upx.1") 101 | # 102 | (sh/$ patchelf --set-rpath 103 | (join-pkg-paths ":" "/lib" 104 | [ucl zlib]) 105 | (string (dyn :pkg-out) "/bin/upx")))) 106 | -------------------------------------------------------------------------------- /community/uthash.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc uthash-src 5 | :file-name 6 | "uthash-2.1.0.tar.gz" 7 | :url 8 | "https://github.com/troydhanson/uthash/archive/v2.1.0.tar.gz" 9 | :hash 10 | "sha256:152ccd8e64d0f495377232e3964d06c7ec8bb8c3fbd3217f8a5702614f9a669e") 11 | 12 | (defpkg uthash 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (string (core/coreutils :path) "/bin")) 17 | (unpack-src uthash-src) 18 | (sh/$ cp -a 19 | src 20 | (dyn :pkg-out) ^ "/include"))) 21 | -------------------------------------------------------------------------------- /community/util-linux.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc util-linux-src 5 | :url "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-2.35.1.tar.gz" 6 | :hash "sha256:37ac05d82c6410d89bc05d43cee101fefc8fe6cf6090b3ce7a1409a6f35db606") 7 | 8 | (defpkg util-linux 9 | :builder 10 | (fn [] 11 | (core/link-/bin/sh) 12 | (os/setenv "PATH" (pkg-path "/bin" core/build-env)) 13 | (os/setenv "CFLAGS" *default-cflags*) 14 | (os/setenv "LDFLAGS" *default-ldflags*) 15 | (unpack-src util-linux-src) 16 | (sh/$ ./configure "--prefix=" ^ (dyn :pkg-out) 17 | "--enable-static-programs=losetup,mount,umount,fdisk,sfdisk,blkid,nsenter,unshare" 18 | --disable-bash-completion 19 | --disable-makeinstall-chown 20 | --disable-makeinstall-setuid) 21 | (sh/$ make -j (dyn :parallelism)) 22 | (sh/$ make install))) 23 | -------------------------------------------------------------------------------- /community/vim.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./ncurses) 4 | 5 | (defsrc vim-src 6 | :file-name 7 | "vim-8.2.091.tar.gz" 8 | :url 9 | "https://github.com/vim/vim/archive/v8.2.0891.tar.gz" 10 | :hash 11 | "sha256:1848dbc78d21e119b9314de06ce9852137d740f8c3fb97f558dea3f7f01bed44") 12 | 13 | (defpkg vim 14 | :builder 15 | (fn [] 16 | (os/setenv "PKG_CONFIG_PATH" 17 | (string (ncurses :path) "/lib/pkgconfig")) 18 | (os/setenv "PATH" 19 | (string "/bin:" # XXX: need sh 20 | (join-pkg-paths ":" "/bin" 21 | [core/awk 22 | core/coreutils 23 | core/findutils 24 | core/gcc 25 | core/grep 26 | core/make 27 | core/pkgconf 28 | core/sed]))) 29 | (os/setenv "CPPFLAGS" 30 | (string *default-cflags* 31 | " " 32 | (sh/$<_ pkg-config --cflags ncurses))) 33 | (os/setenv "LDFLAGS" 34 | (string *default-ldflags* 35 | " " 36 | (sh/$<_ pkg-config --libs ncurses))) 37 | # 38 | (core/link-/bin/sh) 39 | (unpack-src vim-src) 40 | # 41 | (sh/$ ./configure 42 | --prefix= ^ (dyn :pkg-out)) 43 | (sh/$ make 44 | -j (dyn :parallelism)) 45 | (sh/$ make install))) 46 | -------------------------------------------------------------------------------- /community/xxhash.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc xxhash-src 5 | :file-name 6 | "xxhash-0.7.3.tar.gz" 7 | :url 8 | "https://github.com/Cyan4973/xxHash/archive/v0.7.3.tar.gz" 9 | :hash 10 | "sha256:952ebbf5b11fbf59ae5d760a562d1e9112278f244340ad7714e8556cbe54f7f7") 11 | 12 | (defpkg xxhash 13 | :builder 14 | (fn [] 15 | (os/setenv "PATH" 16 | (join-pkg-paths ":" "/bin" 17 | [core/coreutils core/gcc core/make 18 | core/sed])) 19 | 20 | (unpack-src xxhash-src) 21 | (core/link-/bin/sh) 22 | (sh/$ make 23 | -j (dyn :parallelism)) 24 | 25 | (sh/$ make 26 | PREFIX= ^ (dyn :pkg-out) 27 | install) 28 | )) 29 | -------------------------------------------------------------------------------- /community/xz.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc xz-src 5 | :url 6 | "https://tukaani.org/xz/xz-5.2.5.tar.gz" 7 | :hash 8 | "sha256:f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10") 9 | 10 | (defpkg xz 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/awk core/coreutils core/gcc core/grep 16 | core/make core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src xz-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make 24 | -j (dyn :parallelism)) 25 | (sh/$ make 26 | install))) 27 | # XXX: pkg-config massaging? 28 | -------------------------------------------------------------------------------- /community/yasm.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc yasm-src 5 | :url 6 | "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" 7 | :hash 8 | "sha256:3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f") 9 | 10 | (defpkg yasm 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/sed core/grep core/awk core/make])) 16 | (os/setenv "CFLAGS" *default-cflags*) 17 | (os/setenv "LDFLAGS" (string *default-ldflags* " --static")) 18 | (unpack-src yasm-src) 19 | (core/link-/bin/sh) 20 | (sh/$ ./configure --prefix= ^ (dyn :pkg-out)) 21 | (sh/$ make -j (dyn :parallelism)) 22 | (sh/$ make install))) 23 | -------------------------------------------------------------------------------- /community/zig.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | (use ./cmake) 4 | (use ./llvmorg) # clang and lld 5 | 6 | (defsrc zig-src 7 | :file-name 8 | "zig-0.6.0.tar.gz" 9 | :url 10 | "https://github.com/ziglang/zig/archive/0.6.0.tar.gz" 11 | :hash 12 | "sha256:a1bc8df40399aff7391cedb401e51579c679cff1c4f7f653cffefdf4d076aa3a") 13 | 14 | (defpkg zig 15 | :builder 16 | (fn [] 17 | (os/setenv "PATH" 18 | (string "/bin:" 19 | (join-pkg-paths ":" "/bin" 20 | [clang 21 | cmake 22 | core/coreutils 23 | core/gcc 24 | lld 25 | core/make]))) 26 | (unless (os/lstat "/bin/ld") 27 | (os/symlink (string (lld :path) "/bin/ld.lld") 28 | "/bin/ld")) 29 | # XXX 30 | (os/setenv "CFLAGS" *default-cflags*) 31 | (os/setenv "LDFLAGS" 32 | (string *default-ldflags* 33 | " " 34 | "-L" (core/gcc :path) "/x86_64-linux-musl/lib" 35 | " " 36 | "-L" (core/gcc :path) "/lib/gcc/x86_64-linux-musl/9.2.0" 37 | " " 38 | "-L" (lld :path) "/lib" 39 | " " 40 | "-L" (clang :path) "/lib")) 41 | # XXX 42 | (os/setenv "LD_LIBRARY_PATH" 43 | (string (core/gcc :path) "/x86_64-linux-musl/lib" 44 | ":" 45 | (core/gcc :path) "/lib/gcc/x86_64-linux-musl/9.2.0" 46 | ":" 47 | (join-pkg-paths ":" "/lib" 48 | [clang lld]))) 49 | (unpack-src zig-src) 50 | # XXX: zig somehow wants $HOME 51 | (os/mkdir "/build/home") 52 | (os/setenv "HOME" "/build/home") 53 | # XXX: hacky and fragile 54 | (rewrite "cmake/Findclang.cmake" 55 | |(string/replace "/mingw64/include" 56 | (string (clang :path) "/include") 57 | $)) 58 | # XXX: hacky and fragile 59 | (rewrite "cmake/Findclang.cmake" 60 | |(string/replace "/mingw64/lib" 61 | (string (clang :path) "/lib") 62 | $)) 63 | # XXX: hacky and fragile 64 | (rewrite "cmake/Findlld.cmake" 65 | |(string/replace "/mingw64/include" 66 | (string (lld :path) "/include") 67 | $)) 68 | # XXX: hacky and fragile 69 | (rewrite "cmake/Findlld.cmake" 70 | |(string/replace "/mingw64/lib" 71 | (string (lld :path) "/lib") 72 | $)) 73 | (core/link-/bin/sh) 74 | # XXX: use cmake options instead of mkdir / cd? 75 | (os/mkdir "build") 76 | (os/cd "build") 77 | (sh/$ cmake 78 | -DCMAKE_INSTALL_PREFIX= ^ (dyn :pkg-out) 79 | -DCMAKE_BUILD_TYPE= ^ None 80 | ..) 81 | (sh/$ make 82 | -j (dyn :parallelism)) 83 | (os/cd "..") 84 | (sh/$ make 85 | -C build 86 | PREFIX= ^ (dyn :pkg-out) 87 | install))) 88 | -------------------------------------------------------------------------------- /community/zlib.hpkg: -------------------------------------------------------------------------------- 1 | (use ../prelude) 2 | (import ../core) 3 | 4 | (defsrc zlib-src 5 | :url 6 | "https://www.zlib.net/zlib-1.2.11.tar.gz" 7 | :hash 8 | "sha256:c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1") 9 | 10 | (defpkg zlib 11 | :builder 12 | (fn [] 13 | (os/setenv "PATH" 14 | (join-pkg-paths ":" "/bin" 15 | [core/coreutils core/gcc core/grep core/make 16 | core/sed])) 17 | (os/setenv "CFLAGS" *default-cflags*) 18 | (os/setenv "LDFLAGS" *default-ldflags*) 19 | (unpack-src zlib-src) 20 | (core/link-/bin/sh) 21 | (sh/$ ./configure 22 | --prefix= ^ (dyn :pkg-out)) 23 | (sh/$ make -j (dyn :parallelism)) 24 | (sh/$ make install))) 25 | -------------------------------------------------------------------------------- /core.hpkg: -------------------------------------------------------------------------------- 1 | (use ./prelude) 2 | (use ./seed) 3 | 4 | (defsrc make-src 5 | :url 6 | "https://ftp.gnu.org/gnu/make/make-4.2.tar.gz" 7 | :hash 8 | "sha256:e968ce3c57ad39a593a92339e23eb148af6296b9f40aa453a9a9202c99d34436") 9 | 10 | (defsrc dash-src 11 | :url 12 | "http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.10.2.tar.gz" 13 | :hash 14 | "sha256:3c663919dc5c66ec991da14c7cf7e0be8ad00f3db73986a987c118862b5f6071") 15 | 16 | (defsrc coreutils-src 17 | :url 18 | "https://ftp.gnu.org/gnu/coreutils/coreutils-8.31.tar.xz" 19 | :hash 20 | "sha256:ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd") 21 | 22 | (defsrc awk-src 23 | :url 24 | "https://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.xz" 25 | :hash 26 | "sha256:8e4e86f04ed789648b66f757329743a0d6dfb5294c3b91b756a474f1ce05a794") 27 | 28 | (defsrc diffutils-src 29 | :url 30 | "https://ftp.gnu.org/gnu/diffutils/diffutils-3.7.tar.xz" 31 | :hash 32 | "sha256:b3a7a6221c3dc916085f0d205abf6b8e1ba443d4dd965118da364a1dc1cb3a26") 33 | 34 | (defsrc findutils-src 35 | :url 36 | "https://ftp.gnu.org/pub/gnu/findutils/findutils-4.7.0.tar.xz" 37 | :hash 38 | "sha256:c5fefbdf9858f7e4feb86f036e1247a54c79fc2d8e4b7064d5aaa1f47dfa789a") 39 | 40 | (defsrc patch-src 41 | :url 42 | "https://ftp.gnu.org/gnu/patch/patch-2.7.tar.gz" 43 | :hash 44 | "sha256:59c29f56faa0a924827e6a60c6accd6e2900eae5c6aaa922268c717f06a62048") 45 | 46 | (defsrc pkgconf-src 47 | :url 48 | "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.6.3.tar.xz" 49 | :hash 50 | "sha256:61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210") 51 | 52 | (defsrc sed-src 53 | :url 54 | "https://ftp.gnu.org/gnu/sed/sed-4.7.tar.xz" 55 | :hash 56 | "sha256:2885768cd0a29ff8d58a6280a270ff161f6a3deb5690b2be6c49f46d4c67bd6a") 57 | 58 | (defsrc grep-src 59 | :url 60 | "https://ftp.gnu.org/gnu/grep/grep-3.3.tar.xz" 61 | :hash 62 | "sha256:b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514") 63 | 64 | (defsrc which-src 65 | :url 66 | "https://ftp.gnu.org/gnu/which/which-2.21.tar.gz" 67 | :hash 68 | "sha256:f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad") 69 | 70 | (defsrc tar-src 71 | :url 72 | "https://ftp.gnu.org/gnu/tar/tar-1.32.tar.gz" 73 | :hash 74 | "sha256:b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c") 75 | 76 | (defsrc gzip-src 77 | :url 78 | "https://ftp.gnu.org/gnu/gzip/gzip-1.10.tar.gz" 79 | :hash 80 | "sha256:c91f74430bf7bc20402e1f657d0b252cb80aa66ba333a25704512af346633c68") 81 | 82 | (defsrc bzip2-src 83 | :url 84 | "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" 85 | :hash 86 | "sha256:ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269") 87 | 88 | (defsrc xz-src 89 | :url 90 | "https://tukaani.org/xz/xz-5.2.4.tar.gz" 91 | :hash 92 | "sha256:b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145") 93 | 94 | # We use make in core-build, so bootstrap it first. 95 | (defpkg make 96 | :builder 97 | (fn [] 98 | (os/setenv "PATH" (pkg-path "/bin" seed)) 99 | (os/setenv "CC" "x86_64-linux-musl-gcc --static") 100 | (os/setenv "CFLAGS" *default-cflags*) 101 | (os/setenv "LDFLAGS" *default-ldflags*) 102 | (unpack-src make-src) 103 | (unless (os/lstat "/bin/sh") 104 | (os/symlink (pkg-path "/bin/busybox" seed) "/bin/sh")) 105 | (sh/$ ./configure --prefix (dyn :pkg-out)) 106 | (sh/$ ./build.sh) 107 | (sh/$ ./make install))) 108 | 109 | (defn- core-builder 110 | [src &opt extra-cfg] 111 | (default extra-cfg []) 112 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [seed make])) 113 | (unpack-src src) 114 | (os/setenv "CC" "x86_64-linux-musl-gcc --static") 115 | (os/setenv "CFLAGS" *default-cflags*) 116 | (os/setenv "LDFLAGS" *default-ldflags*) 117 | (unless (os/lstat "/bin/sh") 118 | (os/symlink (pkg-path "/bin/busybox" seed) "/bin/sh")) 119 | (sh/$ ash ./configure ;extra-cfg --prefix= ^ (dyn :pkg-out)) 120 | (sh/$ make 121 | CFLAGS= ^ ,*default-cflags* 122 | -j (dyn :parallelism)) 123 | (sh/$ make install)) 124 | 125 | (defpkg dash 126 | :builder 127 | |(do 128 | (core-builder dash-src) 129 | (os/cd (string (dyn :pkg-out) "/bin")) 130 | (os/symlink "./dash" "sh"))) 131 | 132 | (defpkg coreutils 133 | :builder 134 | |(core-builder coreutils-src)) 135 | 136 | (defpkg awk 137 | :builder 138 | |(core-builder awk-src)) 139 | 140 | (defpkg diffutils 141 | :builder 142 | |(core-builder diffutils-src)) 143 | 144 | (defpkg findutils 145 | :builder 146 | |(core-builder findutils-src)) 147 | 148 | (defpkg patch 149 | :builder 150 | |(core-builder patch-src)) 151 | 152 | (defpkg pkgconf 153 | :builder 154 | |(do 155 | (core-builder pkgconf-src ["--enable-shared=no"]) 156 | (os/cd (string (dyn :pkg-out) "/bin")) 157 | (os/symlink "./pkgconf" "pkg-config"))) 158 | 159 | (defpkg sed 160 | :builder 161 | |(core-builder sed-src)) 162 | 163 | (defpkg grep 164 | :builder 165 | |(core-builder grep-src)) 166 | 167 | (defpkg gzip 168 | :builder 169 | |(core-builder gzip-src)) 170 | 171 | (defpkg which 172 | :builder 173 | |(core-builder which-src)) 174 | 175 | (defpkg tar 176 | :builder 177 | |(core-builder tar-src)) 178 | 179 | (defpkg xz 180 | :builder 181 | |(core-builder xz-src ["--enable-shared=no"])) 182 | 183 | # bzip2 doesn't really fit any pattern 184 | (defpkg bzip2 185 | :builder 186 | (fn [] 187 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [seed make])) 188 | (unpack-src bzip2-src) 189 | (rewrite "Makefile" 190 | |(string/replace "SHELL=/bin/sh" "SHELL=sh" $)) 191 | (sh/$ 192 | make install 193 | -j (dyn :parallelism) 194 | CC= ^ "x86_64-linux-musl-gcc --static" 195 | CFLAGS= ^ ,*default-cflags* 196 | LDFLAGS= ^ ,*default-ldflags* 197 | PREFIX= ^ (dyn :pkg-out)))) 198 | 199 | (defn link-/bin/sh 200 | [] 201 | # When building without a sandbox, this can't be done. 202 | (unless (os/lstat "/bin/sh") 203 | (os/symlink (pkg-path "/bin/dash" dash) "/bin/sh"))) 204 | 205 | (defsrc musl-cross-make-src 206 | :url "https://github.com/richfelker/musl-cross-make/archive/v0.9.9.tar.gz" 207 | :hash "sha256:ff3e2188626e4e55eddcefef4ee0aa5a8ffb490e3124850589bcaf4dd60f5f04") 208 | 209 | (defsrc gcc-src 210 | :url "https://ftp.gnu.org/pub/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz" 211 | :hash "sha256:ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206") 212 | 213 | (defsrc binutils-src 214 | :url "https://ftp.gnu.org/pub/gnu/binutils/binutils-2.33.1.tar.xz" 215 | :hash "sha256:ab66fc2d1c3ec0359b8e08843c9f33b63e8707efdff5e4cc5c200eae24722cbf") 216 | 217 | (defsrc gmp-src 218 | :url "https://ftp.gnu.org/pub/gnu/gmp/gmp-6.1.2.tar.bz2" 219 | :hash "sha256:5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2") 220 | 221 | (defsrc mpc-src 222 | :url "https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz" 223 | :hash "sha256:6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e") 224 | 225 | (defsrc mpfr-src 226 | :url "https://ftp.gnu.org/pub/gnu/mpfr/mpfr-4.0.2.tar.bz2" 227 | :hash "sha256:c05e3f02d09e0e9019384cdd58e0f19c64e6db1fd6f5ecf77b4b1c61ca253acc") 228 | 229 | (defsrc musl-src 230 | :url "https://www.musl-libc.org/releases/musl-1.2.0.tar.gz" 231 | :hash "sha256:c6de7b191139142d3f9a7b5b702c9cae1b5ee6e7f57e582da9328629408fd4e8") 232 | 233 | (defsrc gcc-linux-src 234 | :url "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.90.tar.xz" 235 | :hash "sha256:29d86c0a6daf169ec0b4b42a12f8d55dc894c52bd901f876f52a05906a5cf7fd") 236 | 237 | # XXX Why does musl cross make download this? 238 | (def- config.sub 239 | (fetch 240 | :url "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=3d5db9ebe860" 241 | :hash "sha256:75d5d255a2a273b6e651f82eecfabf6cbcd8eaeae70e86b417384c8f4a58d8d3" 242 | :file-name "config.sub")) 243 | 244 | (def mcm-gcc 245 | (pkg 246 | :name "mcm-gcc" 247 | :builder 248 | (fn [] 249 | # Can we fix the buid scripts and pass them the shell? 250 | (link-/bin/sh) 251 | 252 | (defn archive-path 253 | [src-pkg] 254 | (first (sh/glob (string (src-pkg :path) "/*")))) 255 | 256 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [make patch seed])) 257 | (unpack (archive-path musl-cross-make-src)) 258 | 259 | (os/mkdir "sources") 260 | (each src [gcc-src binutils-src musl-src gmp-src mpc-src mpfr-src gcc-linux-src] 261 | (sh/$ cp (archive-path src) "./sources")) 262 | (sh/$ cp (string (config.sub :path) "/config.sub") "./sources") 263 | 264 | (spit "config.mak" 265 | (string 266 | "TARGET=x86_64-linux-musl\n" 267 | "LINUX_VER = 4.19.90\n" 268 | "OUTPUT=" (dyn :pkg-out) "\n" 269 | "GCC_CONFIG += --disable-libquadmath --disable-decimal-float --disable-libitm --disable-fixed-point\n" 270 | "COMMON_CONFIG += --enable-new-dtags\n" 271 | "COMMON_CONFIG += CC=\"gcc -static --static\"\n" 272 | "COMMON_CONFIG += CXX=\"g++ -static --static\"\n" 273 | "COMMON_CONFIG += CFLAGS=\"-O3\" CXXFLAGS=\"-O3\" LDFLAGS=\"-s\"\n" 274 | "DL_CMD=false\n" 275 | "COWPATCH=" (os/cwd) "/cowpatch.sh\n")) 276 | # XXX This patch is not very robust, remove it if you find a better way. 277 | (rewrite "litecross/Makefile" 278 | |(string/replace-all "kernel_headers && $(MAKE) " 279 | "kernel_headers && $(MAKE) HOSTCFLAGS=--static " 280 | $)) 281 | # XXX In builds that don't isolate /bin/sh, some versions of bash fail... 282 | (rewrite "cowpatch.sh" 283 | |(string/replace "#!/bin/sh" 284 | (string "#!" (dash :path) "/bin/dash") 285 | $)) 286 | 287 | (sh/$ make extract_all) 288 | (sh/$ make -j (dyn :parallelism)) 289 | (sh/$ make install) 290 | 291 | (os/cd (string (dyn :pkg-out) "/bin")) 292 | (os/symlink "./x86_64-linux-musl-ar" "ar") 293 | (os/symlink "./x86_64-linux-musl-as" "as") 294 | (os/symlink "./x86_64-linux-musl-c++" "c++") 295 | (os/symlink "./x86_64-linux-musl-c++" "g++") 296 | (os/symlink "./x86_64-linux-musl-cpp" "cpp") 297 | (os/symlink "./x86_64-linux-musl-gcc" "cc") 298 | (os/symlink "./x86_64-linux-musl-gcc" "gcc") 299 | (os/symlink "./x86_64-linux-musl-ld" "ld") 300 | (os/symlink "./x86_64-linux-musl-nm" "nm") 301 | (os/symlink "./x86_64-linux-musl-objcopy" "objcopy") 302 | (os/symlink "./x86_64-linux-musl-objdump" "objdump") 303 | (os/symlink "./x86_64-linux-musl-readelf" "readelf") 304 | (os/symlink "./x86_64-linux-musl-ranlib" "ranlib") 305 | (os/symlink "./x86_64-linux-musl-strings" "strings") 306 | (os/symlink "./x86_64-linux-musl-strip" "strip")))) 307 | 308 | # The runtime package is a gcc installation with only dynamic libraries. 309 | (defn- prepare-gcc-rt 310 | [remove-c++] 311 | (pkg 312 | :name "rt" 313 | :builder 314 | (fn [] 315 | (os/setenv "PATH" (string (seed :path) "/bin")) 316 | (sh/$ cp -rv ;(sh/glob (string (mcm-gcc :path) "/*")) (dyn :pkg-out)) 317 | (sh/$ chmod -R +w (dyn :pkg-out)) 318 | 319 | (when remove-c++ 320 | (sh/$ rm ;(sh/glob (string (dyn :pkg-out) "/x86_64-linux-musl/lib/*c++*")))) 321 | 322 | # Remove things that aren't dynamic libs. 323 | (sh/$ find (dyn :pkg-out) -not -name *.so* -delete) 324 | 325 | # XXX Fix broken link, why is this broken? 326 | (def ld.so (string (dyn :pkg-out) "/x86_64-linux-musl/lib/ld-musl-x86_64.so.1")) 327 | (os/rm ld.so) 328 | (os/symlink "libc.so" ld.so) 329 | 330 | # Manually configure path with musl config. 331 | (os/mkdir (string (dyn :pkg-out) "/x86_64-linux-musl/etc")) 332 | (spit 333 | (string (dyn :pkg-out) "/x86_64-linux-musl/etc/ld-musl-x86_64.path") 334 | (string (dyn :pkg-out) "/x86_64-linux-musl/lib\n"))))) 335 | 336 | (defn- prepare-gcc 337 | [gcc-rt] 338 | (pkg 339 | :name "gcc" 340 | :builder 341 | (fn [] 342 | (os/setenv "PATH" (pkg-path "/bin" seed)) 343 | (sh/$ cp -rv ;(sh/glob (string (mcm-gcc :path) "/*")) (dyn :pkg-out)) 344 | (sh/$ chmod -R +w (dyn :pkg-out)) 345 | (def specs (sh/$< (string (dyn :pkg-out) "/bin/gcc") -dumpspecs)) 346 | (def new-specs 347 | (string/replace-all 348 | "/lib/ld-musl-x86_64.so.1" 349 | (string (gcc-rt :path) "/x86_64-linux-musl/lib/ld-musl-x86_64.so.1") 350 | specs)) 351 | (spit (string (dyn :pkg-out) "/x86_64-linux-musl/lib/specs") new-specs)))) 352 | 353 | (def gcc-rt (prepare-gcc-rt false)) 354 | (def gcc-rt-lite (prepare-gcc-rt true)) 355 | (def gcc (prepare-gcc gcc-rt)) 356 | (def gcc-lite (prepare-gcc gcc-rt-lite)) 357 | 358 | (defpkg core-env 359 | :builder 360 | (fn [] 361 | (def pkgs 362 | [awk 363 | bzip2 364 | coreutils 365 | dash 366 | diffutils 367 | findutils 368 | grep 369 | gzip 370 | patch 371 | sed 372 | tar 373 | which 374 | xz]) 375 | (def bin-out (string (dyn :pkg-out) "/bin")) 376 | (os/mkdir bin-out) 377 | (link-farm (map |(pkg-path "/bin" $) pkgs) bin-out))) 378 | 379 | (defpkg build-env 380 | :builder 381 | (fn [] 382 | (def pkgs [core-env 383 | pkgconf 384 | make 385 | gcc]) 386 | (def bin-out (string (dyn :pkg-out) "/bin")) 387 | (os/mkdir bin-out) 388 | (link-farm (map |(pkg-path "/bin" $) pkgs) bin-out))) 389 | -------------------------------------------------------------------------------- /prelude.hpkg: -------------------------------------------------------------------------------- 1 | # Some suggestions to packages. 2 | (def *default-cflags* "-O2 -fstack-protector") 3 | (def *default-ldflags* "-s") 4 | 5 | (defn pkg-path 6 | [sfx pkg] 7 | (string (pkg :path) sfx)) 8 | 9 | (defn join-pkg-paths 10 | [sep sfx pkgs] 11 | (string/join (map |(pkg-path sfx $) pkgs) sep)) 12 | 13 | (defn link-farm 14 | [paths dest &opt pred] 15 | (each p paths 16 | (each name (os/dir p) 17 | (def path (string p "/" name)) 18 | (def link (string dest "/" name)) 19 | (unless (os/lstat link) 20 | (when (or (nil? pred) (pred path)) 21 | (def target (os/realpath (string p "/" name))) 22 | (os/symlink target link)))))) 23 | 24 | (defn rewrite 25 | [p xform] 26 | (spit p (xform (slurp p)))) 27 | 28 | (defmacro defsrc 29 | [name &keys {:url url :hash hash :file-name file-name}] 30 | ~(def ,name (,fetch :url ,url :hash ,hash :file-name ,file-name))) 31 | 32 | (defn unpack-src 33 | [src-pkg] 34 | (unpack ;(sh/glob (string (src-pkg :path) "/*")))) 35 | 36 | (defmacro defpkg 37 | [name &keys kwargs] 38 | ~(def ,name ,(tuple pkg :name (string name) ;(kvs kwargs)))) 39 | -------------------------------------------------------------------------------- /seed-out.hpkg: -------------------------------------------------------------------------------- 1 | (use ./prelude) 2 | (import ./seed) 3 | (import ./core) 4 | (import ./community/busybox) 5 | 6 | (defpkg new-seed 7 | :builder 8 | (fn [] 9 | (os/setenv "PATH" (pkg-path "/bin" seed/seed)) 10 | (sh/$ cp -rv ;(sh/glob (string (core/mcm-gcc :path) "/*")) (dyn :pkg-out)) 11 | (sh/$ chmod -R +w (dyn :pkg-out)) 12 | # XXX This is done for reproducibile build, is there a better way? 13 | (os/rm ;(sh/glob (string (dyn :pkg-out) "/libexec/gcc/x86_64-linux-musl/*/install-tools/fixincl"))) 14 | (sh/$ cp (pkg-path "/bin/busybox" busybox/busybox) (string (dyn :pkg-out) "/bin")) 15 | (os/cd (string (dyn :pkg-out) "/bin")) 16 | (each app (string/split "\n" (sh/$<_ ./busybox --list)) 17 | # strings comes from gcc/binutils. 18 | (unless (os/lstat app) 19 | (os/symlink "./busybox" app))))) 20 | 21 | (defpkg seed-out 22 | :content {"seed.tar.gz" {:content seed/seed-hash}} 23 | :builder 24 | (fn [] 25 | (os/setenv "LC_ALL" "C") 26 | (os/setenv "PATH" (join-pkg-paths ":" "/bin" [core/tar core/gzip new-seed])) 27 | (os/cd (new-seed :path)) 28 | (with [f (file/open (string (dyn :pkg-out) "/seed.tar.gz") :wb+)] 29 | (sh/$ 30 | find . 31 | |grep -v ".hpkg.jdn" 32 | |sort 33 | |tar --owner=root:0 --group=root:0 "--mtime=UTC 2019-01-01" --no-recursion -v -T - -cf - 34 | |gzip -9 35 | > ,f)))) 36 | -------------------------------------------------------------------------------- /seed.hpkg: -------------------------------------------------------------------------------- 1 | (def seed-hash "sha256:73f4d678e94d35575981c031c255e77ebd05899c0d4f4bb318f7fb848658a3ed") 2 | 3 | (def seed-tarball 4 | (fetch 5 | :url 6 | "https://github.com/andrewchambers/hpkgs-seeds/raw/274e167bea337b127c56f4ebdc919268a5a680e7/linux-x86_64-seed.tar.gz" 7 | :hash 8 | seed-hash)) 9 | 10 | (def seed 11 | (pkg 12 | :name 13 | "seed" 14 | :builder 15 | |(unpack ;(sh/glob (string (seed-tarball :path) "/*")) :dest (dyn :pkg-out)))) 16 | --------------------------------------------------------------------------------