Skip to content

Instantly share code, notes, and snippets.

@puigru
Created January 2, 2024 17:08
Show Gist options
  • Save puigru/608f94da8079b3e2d6d169bf62d16641 to your computer and use it in GitHub Desktop.
Save puigru/608f94da8079b3e2d6d169bf62d16641 to your computer and use it in GitHub Desktop.
Dockerfile to build mwarning/p2p-gui (WIP)
FROM debian:bookworm
# set up build environment
RUN apt-get -y update \
&& apt-get install -y unzip make subversion wget build-essential zlib1g-dev libssl-dev \
&& cd /root \
# taken from https://www.dsource.org/projects/tango/wiki/ManualLinuxInstall
# note: we're using the latest published version of D1 1.076 due to things like
# https://issues.dlang.org/show_bug.cgi?id=5963 (fixed in 1.069)
# https://issues.dlang.org/show_bug.cgi?id=7351 (fixed in 1.073)
&& wget http://ftp.digitalmars.com/dmd.1.076.zip \
&& unzip dmd.1*.zip \
&& rm dmd.1*.zip \
&& mkdir -p /opt/dmd/bin \
&& cp -r dmd/linux/bin64/* /opt/dmd/bin \
&& chmod a+x /opt/dmd/bin/dmd \
&& export PATH=/opt/dmd/bin:$PATH \
&& svn co http://svn.dsource.org/projects/tango/trunk \
&& cd trunk \
&& ./build/bin/linux64/bob -vu -m=64 -r=dmd -c=dmd . \
&& mkdir /opt/dmd/lib \
&& cp libtango.a /opt/dmd/lib/libtango.a \
&& mkdir /opt/dmd/import \
&& cp -r object.di tango /opt/dmd/import/ \
# note: added -L--no-pie and -L--verbose
&& export DFLAGS='-L--no-pie -L--verbose -I%@P%/../import -I%@P%/../import/tango/core/vendor -L-L%@P%/../lib -version=Tango -defaultlib=tango -debuglib=tango' \
&& sed -i "s|DFLAGS=.*|DFLAGS=$DFLAGS|" /opt/dmd/bin/dmd.conf
# build
RUN apt-get install -y git \
&& cd /root \
&& git clone https://github.com/mwarning/p2p-gui \
&& cd p2p-gui \
&& printf '%s\n' \
'diff --git a/api/File.d b/api/File.d' \
'index 5210a19..2bff8fc 100755' \
'--- a/api/File.d' \
'+++ b/api/File.d' \
'@@ -62,7 +62,7 @@ interface File : Files, Connection' \
'' \
' class NullFile : File' \
' {' \
'- private this() {}' \
'+ this() {}' \
' uint getId() { return 0; }' \
' uint getLastChanged() { return 0; }' \
' char[] getName() { return null; }' \
| git apply - \
&& export PATH=/opt/dmd/bin:$PATH \
&& make dmd-linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment