From 2c9eb1e24b0545ac3ef58ec9ce8504390bf86a74 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 5 Aug 2022 16:22:53 -0400 Subject: [PATCH] +libpng+pixman+gperf+pcre+pixman+bison (#77) --- README.md | 4 ++++ projects/gnu.org/bison/package.yml | 33 +++++++++++++++++++++++++++++ projects/gnu.org/bison/test.y | 19 +++++++++++++++++ projects/gnu.org/gperf/package.yml | 17 +++++++++++++++ projects/libpng.org/package.yml | 31 +++++++++++++++++++++++++++ projects/libpng.org/test.c | 8 +++++++ projects/pcre.org/package.yml | 34 ++++++++++++++++++++++++++++++ projects/python.org/package.yml | 13 +++++++++--- 8 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 projects/gnu.org/bison/package.yml create mode 100644 projects/gnu.org/bison/test.y create mode 100644 projects/gnu.org/gperf/package.yml create mode 100644 projects/libpng.org/package.yml create mode 100644 projects/libpng.org/test.c create mode 100644 projects/pcre.org/package.yml diff --git a/README.md b/README.md index 8da44ad2..fcb461e3 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ If you have a website you can host your own `package.yml` there and we will build binaries for you. This feature is coming soon and will require signed, versioned tags and signed source tarballs. +# Packaging Knowledgebase + +Our [wiki](/wiki) is our knowledgebase. Fill it with the fruits of your +knowledge. Please keep it tidy. # Dependencies diff --git a/projects/gnu.org/bison/package.yml b/projects/gnu.org/bison/package.yml new file mode 100644 index 00000000..91973798 --- /dev/null +++ b/projects/gnu.org/bison/package.yml @@ -0,0 +1,33 @@ +distributable: + url: https://ftp.gnu.org/gnu/bison/bison-{{ version }}.tar.xz + strip-components: 1 + +versions: + github: akimd/bison/tags + +dependencies: + # bison cannot operate without the m4 executable + gnu.org/m4: 1 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: | + ./configure $ARGS + make --jobs {{ hw.concurrency }} install + env: + M4: m4 # or fails on Linux + ARGS: + - --prefix={{ prefix }} + - --enable-relocatable + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + bison {{ pkg.pantry-prefix }}/test.y + c++ test.tab.c + test pass = $(echo "((()(())))()" | ./a.out) + test fail = $(echo "())" | ./a.out) + diff --git a/projects/gnu.org/bison/test.y b/projects/gnu.org/bison/test.y new file mode 100644 index 00000000..e50b9f0a --- /dev/null +++ b/projects/gnu.org/bison/test.y @@ -0,0 +1,19 @@ +%{ #include + using namespace std; + extern void yyerror (char *s); + extern int yylex (); +%} +%start prog +%% +prog: // empty + | prog expr '\n' { cout << "pass"; exit(0); } + ; +expr: '(' ')' + | '(' expr ')' + | expr expr + ; +%% +char c; +void yyerror (char *s) { cout << "fail"; exit(0); } +int yylex () { cin.get(c); return c; } +int main() { yyparse(); } diff --git a/projects/gnu.org/gperf/package.yml b/projects/gnu.org/gperf/package.yml new file mode 100644 index 00000000..58282653 --- /dev/null +++ b/projects/gnu.org/gperf/package.yml @@ -0,0 +1,17 @@ +distributable: + url: https://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz + strip-components: 1 + +versions: + - 3.1.0 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: | + ./configure --prefix={{ prefix }} + make --jobs {{ hw.concurrency }} install + +test: + script: echo "tea\nfoo\nbar" | gperf diff --git a/projects/libpng.org/package.yml b/projects/libpng.org/package.yml new file mode 100644 index 00000000..0f6ba20b --- /dev/null +++ b/projects/libpng.org/package.yml @@ -0,0 +1,31 @@ +distributable: + url: https://cytranet.dl.sourceforge.net/project/libpng/libpng{{ version.major }}{{ version.minor }}/{{ version }}/libpng-{{ version }}.tar.xz + #FIXME our linux docker image TLS doesn’t like this URL + # url: https://downloads.sourceforge.net/project/libpng/libpng{{ version.major }}{{ version.minor }}/{{ version }}/libpng-{{ version }}.tar.xz + strip-components: 1 + +versions: + github: glennrp/libpng + strip: /^libpng-/ + +dependencies: + zlib.net: 1 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: |- + ./configure \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --prefix {{ prefix }} + make --jobs {{ hw.concurrency }} + make install + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + cc {{ pkg.pantry-prefix }}/test.c -lpng + ./a.out diff --git a/projects/libpng.org/test.c b/projects/libpng.org/test.c new file mode 100644 index 00000000..41e6ef4b --- /dev/null +++ b/projects/libpng.org/test.c @@ -0,0 +1,8 @@ +#include +int main() +{ + png_structp png_ptr; + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + return 0; +} diff --git a/projects/pcre.org/package.yml b/projects/pcre.org/package.yml new file mode 100644 index 00000000..cbfea112 --- /dev/null +++ b/projects/pcre.org/package.yml @@ -0,0 +1,34 @@ +distributable: + #FIXME certs issue + # url: https://downloads.sourceforge.net/project/pcre/pcre/{{ version.raw }}/pcre-{{ version.raw }}.tar.bz2 + url: https://cytranet.dl.sourceforge.net/project/pcre/pcre/{{ version.raw }}/pcre-{{ version.raw }}.tar.bz2 + strip-components: 1 + +# commonly called PCRE2 starts at semver v10 +# PCRE (unmaintained) goes up to 8.45 +# despite PCRE being unmaintained, most stuff still uses it, lol + +versions: + - 8.45 + +dependencies: + sourceware.org/bzip2: 1 + zlib.net: 1 + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + script: | + ./configure \ + --prefix={{ prefix }} \ + --enable-pcre2-16 \ + --enable-pcre2-32 \ + --enable-pcre2grep-libz \ + --enable-pcre2grep-libbz2 \ + --enable-jit + make --jobs {{ hw.concurrency }} + make install + +test: + script: pcregrep "regular expression" {{ prefix }}/share/doc/pcre/README diff --git a/projects/python.org/package.yml b/projects/python.org/package.yml index dcb693a1..3d68275e 100644 --- a/projects/python.org/package.yml +++ b/projects/python.org/package.yml @@ -18,6 +18,9 @@ dependencies: gnu.org/readline: 8 invisible-island.net/ncurses: 6 +#TODO pip should be python.org/pip and installed by default (as a recommended dependent) with python +#RATIONALE it is independently versioned + build: dependencies: tea.xyz/gx/cc: c99 @@ -32,8 +35,11 @@ build: ./configure $ARGS make --jobs {{ hw.concurrency }} make install + cd {{ prefix }}/bin - ln -sf python{{ version.major }} python + ln -sf python{{ version.marketing }} python + ln -sf python{{ version.marketing }}-config python-config + ln -sf pip{{ version.marketing }} pip env: SHARE: /opt/python.org/share @@ -42,7 +48,7 @@ build: # it’s 202x - --enable-ipv6 # prevent auto updates -> we control that - - --without-ensurepip + # - --without-ensurepip - --disable-loadable-sqlite-extensions # use our libraries not the bundled ones - --with-system-expat @@ -75,5 +81,6 @@ build: test: #TODO test all modules eg zlib module - script: + script: | python --version + pip --version