Last active
August 3, 2021 21:58
-
-
Save eschen42/b1ec73a394b13d04617500ded211c1e6 to your computer and use it in GitHub Desktop.
icon-cbuilder Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Dockerfile to build icon without graphics, producing | |
| # - statically and dynamically linked iconx | |
| # - statically linked icont | |
| # Note that the dynamic linking is linked: | |
| # - to musl https://musl.libc.org/ | |
| # - rather than glibc https://www.gnu.org/software/libc/ | |
| FROM eschen42/alpine-cbuilder:release-v3.14.0 | |
| # Note that this image does not /usr/include/X11/Xlib.h, so: | |
| # - `make Configure` rather than `make X-Configure` | |
| # - do not copy the graphics content from IPL | |
| LABEL maintainer="'Art Eschenlauer, [email protected]'" | |
| LABEL reference="'https://github.com/eschen42/alpine-cbuilder'" \ | |
| motivation="'Compile statically-linked binaries for icon and jcon translators.'" | |
| # Build Icon; don't build IPL procs and progs | |
| RUN export TARGET=/usr/local/share \ | |
| && export SOURCE=/src \ | |
| && cd $SOURCE && wget https://github.com/gtownsend/icon/archive/refs/heads/master.zip \ | |
| && unzip master.zip && rm master.zip && mv icon-master icon && cd icon \ | |
| && make Configure name=linux_musl \ | |
| && export LDFLAGS="--static" \ | |
| && make && make Test \ | |
| && make Install dest=$TARGET/icon \ | |
| && cd $SOURCE/icon/ipl && mkdir $TARGET/icon/ipl \ | |
| && cp -R data docs incl packs procs progs $TARGET/icon/ipl \ | |
| && cd $SOURCE/icon && cp Makedefs Makedefs.dynamic && mv Makedefs Makedefs.static \ | |
| && ln -s Makedefs.static Makedefs && sh -c 'echo RLINK += --static >> Makedefs' \ | |
| && make Clean && make && cp src/runtime/iconx $TARGET/icon/bin/iconx.static \ | |
| && cd $TARGET/icon/bin && mv iconx iconx.dynamic && ln -s iconx.static iconx \ | |
| && cd $SOURCE/icon && rm Makedefs && ln -s Makedefs.dynamic Makedefs \ | |
| && make Clean \ | |
| && cd /usr/local/bin && ln -s $TARGET/icon/bin/* . \ | |
| && cd /usr/share/man/man1 && ln -s $TARGET/icon/man/man1/* . \ | |
| && rm -rf $SOURCE/icon | |
| # Copy the musl libc to run the dynamically linked iconx on non-musl distributions. | |
| RUN export TARGET=/usr/local/share \ | |
| && cp /lib/ld-musl-x86_64.so.1 $TARGET/icon/bin/ \ | |
| && echo '# Dynamic Linking' > $TARGET/icon/bin/README \ | |
| && echo 'To use dynamic linking, e.g., for loadfunc, do the following from this directory:' >> $TARGET/icon/bin/README \ | |
| && echo '```' >> $TARGET/icon/bin/README \ | |
| && echo 'sudo ln -s `readlink -f ld-musl-x86_64.so.1` /lib/ld-musl-x86_64.so.1' >> $TARGET/icon/bin/README \ | |
| && echo 'sudo echo `readlink -f .` > /lib/ld-musl-x86_64.path' >> $TARGET/icon/bin/README \ | |
| && echo 'ln -f -s iconx.dynamic iconx' >> $TARGET/icon/bin/README \ | |
| && echo '```' >> $TARGET/icon/bin/README | |
| COPY Dockerfile /Dockerfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment