+libpng+pixman+gperf+pcre+pixman+bison (#77)

This commit is contained in:
Max Howell 2022-08-05 16:22:53 -04:00 committed by GitHub
parent c7e3d90b60
commit 2c9eb1e24b
8 changed files with 156 additions and 3 deletions

View file

@ -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

View file

@ -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)

View file

@ -0,0 +1,19 @@
%{ #include <iostream>
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(); }

View file

@ -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

View file

@ -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 doesnt 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

View file

@ -0,0 +1,8 @@
#include <png.h>
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;
}

View file

@ -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

View file

@ -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:
# its 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