flatpak/com.vscodium.codium/tool.DLang/com.vscodium.codium.tool.DL...

241 lines
11 KiB
YAML

id: "com.vscodium.codium.tool.DLang"
build-extension: true
branch: "21.08"
runtime: com.vscodium.codium
sdk: org.freedesktop.Sdk//21.08
runtime-version: stable
separate-locales: false
build-options:
append-path: /app/tools/DLang/bin
env:
- SOURCE_DATE_EPOCH=1
prefix: /app/tools/DLang
modules:
- name: gcc-d
sources:
- type: archive
url: https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz
sha256: f0837f1bf8244a5cc23bd96ff6366712a791cfae01df8e25b137698aca26efc1
- type: archive
url: https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz
sha256: 2c7f4f0d370801b2849c48c9ef3f59553b5f1d3791d070cffb04599f9fc67b41
dest: gmp
- type: archive
url: https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
sha256: 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
dest: mpc
- type: archive
url: https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.gz
sha256: 3127fe813218f3a1f0adf4e8899de23df33b4cf4b4b3831a5314f78e65ffa2d6
dest: mpfr
- type: shell
commands:
- sed -i 's|m64=../lib64|m64=../lib|' gcc/config/i386/t-linux64
config-opts:
- --disable-bootstrap
- --disable-multilib
- --enable-default-pie
- --enable-default-ssp
- --enable-languages=d,lto
- --enable-libphobos-checking
- --enable-linker-build-id
- --enable-lto
- --enable-nls
- --enable-targets=all
- --enable-threads
- --enable-tls
- --enable-vtable-verify
- --without-binutils
post-install:
- mkdir -p /app/tools/DLang/include/dlang
- ln -s ../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/d /app/tools/DLang/include/dlang/gcc
build-options:
cflags: -Os
cppflags: -Os
ldflags: -Os
cleanup:
- /share/info
- /share/man
- name: gdmd
sources:
- type: archive
url: https://github.com/D-Programming-GDC/gdmd/archive/script-0.1.0.tar.gz
sha256: 6c9891b7f2e41d8b6c0e89fab3ad32fb77bb3617760b33a4c23bca49197a026b
- type: shell
commands:
- sed -i 's|prefix = /usr/local|prefix = /app/tools/DLang|' Makefile
buildsystem: simple
build-commands:
- make install
cleanup:
- /share
#- name: ldc
# sources:
# - type: archive
# url: https://github.com/ldc-developers/ldc/releases/download/v1.25.1/ldc-1.25.1-src.tar.gz
# sha256: 0e3716fe9927be91264d1fde5c41071026f6c44262735e9ebda538089b612d40
# - type: archive
# url: https://github.com/ldc-developers/druntime/archive/refs/tags/ldc-v1.25.1.tar.gz
# sha256: 85e339dd778a6c23fdaceac7be4765417932ee80d127e62a4081828ee9571693
# dest: runtime/druntime
# - type: archive
# url: https://github.com/ldc-developers/phobos/archive/refs/tags/ldc-v1.25.0.tar.gz
# sha256: b32a75f0265a7e48f09aef5c798f518a5c22573d156d527893b0663b036ddb09
# dest: runtime/phobos
# buildsystem: cmake-ninja
# builddir: true
# config-opts:
# - -DCMAKE_BUILD_TYPE=Release
# - -DCMAKE_SKIP_RPATH=ON
# - -DINCLUDE_INSTALL_DIR=/app/tools/DLang/include/dlang/ldc
# - -DBUILD_SHARED_LIBS=BOTH
# - -DBUILD_LTO_LIBS=ON
# - -DLDC_WITH_LLD=OFF
# build-options:
# append-ld-library-path: /app/tools/DLang/lib
#- name: libs-fix
# buildsystem: simple
# build-commands:
# - mkdir -p /app/tools/DLang/binexec
# - echo -e '#! /usr/bin/env bash\nLD_LIBRARY_PATH="$(realpath "$(dirname "$0")/../lib"):$LD_LIBRARY_PATH" exec "$(dirname "$0")/../binexec/{{i}}" "$@"' > template.sh
# - for i in /app/tools/DLang/bin/*; do mv -v "$i" "$(dirname "$i")/../binexec"; cat template.sh | sed "s|{{i}}|$(basename "$i")|" > $i; chmod +x "$i"; done
- name: rsync
sources:
- type: archive
url: https://github.com/WayneD/rsync/archive/v3.2.3.tar.gz
sha256: 3127c93d7081db075d1057a44b0bd68ff37f297ba9fe2554043c3e4481ae5056
config-opts:
- --disable-debug
- --disable-md2man
- --disable-xxhash
- --disable-zstd
- --disable-lz4
- name: dub
sources:
- type: git
url: https://github.com/dlang/dub.git
tag: v1.27.0
commit: 7145f2c3d8f06a64b2012113a9aa3548e1cdbe58
- dub_deps.json
buildsystem: simple
build-commands:
- gdmd -ofdub -release -O -version=DubUseCurl -Isource -L-lcurl @build-files.txt
- ./dub build -c application --combined -b release --compiler=gdc
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: dmd
sources:
- type: git
url: https://github.com/dlang/dmd.git
tag: &DMD_VERSION
v2.098.1
commit: 821f82efbb2f15e03cb04c8b0057bb6df82a428b
dest: dmd
- type: git
url: https://github.com/dlang/druntime.git
tag: *DMD_VERSION
commit: 531e2b777aa0ef083f3082659372fad3d4c487fb
dest: druntime
- type: git
url: https://github.com/dlang/phobos.git
tag: *DMD_VERSION
commit: 0425866dcde6debcde73ce5b3e1de5be49cecc97
dest: phobos
- type: git
url: https://github.com/dlang/tools.git
tag: *DMD_VERSION
commit: 63b3867816e13ce5f074fd4342ca240d901f4e31
dest: tools
buildsystem: simple
build-commands:
# Prepare
- sed -i 's/.deps(\[versionFile, sysconfDirFile, lexer, backend\])/.deps(\[versionFile, sysconfDirFile\])/' dmd/src/build.d
- sed -i 's/dmdSources.chain(lexer.targets, backend.targets)/dmdSources.chain(sources.lexer, sources.backend)/' dmd/src/build.d
- sed -Ei 's/OVERRIDE_MEMALLOC\W+=\W*[^;]+;/OVERRIDE_MEMALLOC = false;/' dmd/src/dmd/root/rmem.d
# Build
- cd dmd && make -f posix.mak BUILD=release ENABLE_RELEASE=1 HOST_DMD=gdmd HOST_DMD_KIND=gdc
- cd druntime && make -f posix.mak BUILD=release ENABLE_RELEASE=1 HOST_DMD=gdmd HOST_DMD_KIND=gdc
- cd phobos && make -f posix.mak DMD=../dmd/generated/linux/release/*/dmd BUILD=release ENABLE_RELEASE=1
- cd tools && make -f posix.mak all RELEASE=1 "-j$FLATPAK_BUILDER_N_JOBS"
# Install dmd
- mkdir -p /app/tools/DLang/etc/ /app/tools/DLang/libexec
- install -Dm755 dmd/generated/linux/release/*/dmd /app/tools/DLang/libexec
- install -Dm755 dmd/generated/linux/release/*/dmd.conf /app/tools/DLang/etc/
- echo -e '#! /usr/bin/env bash\nexec "$(dirname "$0")/../libexec/dmd" "-conf=$(dirname "$0")/../etc/dmd.conf" "-L-L$(dirname "$0")/../lib/" "-I$(dirname "$0")/../include/dlang/dmd" "$@"' > /app/tools/DLang/bin/dmd
- chmod +x /app/tools/DLang/bin/dmd
# Install druntime
- mkdir -p /app/tools/DLang/include/dlang/dmd
- cp -rav druntime/import/. /app/tools/DLang/include/dlang/dmd/.
- cp -rav druntime/generated/linux/release/*/. /app/tools/DLang/lib/.
# Install phobos
- cp -rav phobos/generated/linux/release/*/. /app/tools/DLang/lib/.
- cp -rav phobos/*.d /app/tools/DLang/include/dlang/dmd/.
- cd phobos && find std etc -type d -print | xargs -I{} mkdir -p /app/tools/DLang/include/dlang/dmd/{}
- cd phobos && find std etc -type f -iname '*.d' -print | xargs -I{} install -Dm644 {} /app/tools/DLang/include/dlang/dmd/{}
# Install tools
- find tools/generated/linux/*/ ! -iname '*.o' -type f -print | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: dub-build-ddox
sources:
- type: git
url: https://github.com/rejectedsoftware/ddox.git
tag: v0.16.17
commit: 83bab96196596e0c060a5478ad6adc35b01058fb
- dub_build_ddox.json
buildsystem: simple
build-commands:
- dub build --skip-registry=all -b release --compiler=dmd
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: dub-build-lint
sources:
- type: git
url: https://github.com/dlang-community/D-Scanner.git
tag: v0.12.0
commit: cdf881c10386bb9cf9115af80daa86a48e93833b
- dub_build_lint.json
buildsystem: simple
build-commands:
- dub build --skip-registry=all -b release --compiler=dmd
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: dcd-client
sources:
- &DCD_SERVER
type: git
url: https://github.com/dlang-community/DCD.git
tag: v0.13.6
commit: 02acaa534b9be65142aed7b202a6a8d5524abf2a
- dcd-client_dependencies.json
buildsystem: simple
build-commands:
- dub build --skip-registry=all -b release -c client --compiler=dmd
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: dcd-server
sources:
- *DCD_SERVER
- dcd-server_dependencies.json
buildsystem: simple
build-commands:
- dub build --skip-registry=all -b release -c server --compiler=dmd
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: serve-d
sources:
- type: git
url: https://github.com/Pure-D/serve-d.git
tag: v0.7.4
commit: e1fcbb82874e2329f15e29a4340b71c0d879e36f
- serve-d.json
buildsystem: simple
build-commands:
- dub build --skip-registry=all -b release --compiler=dmd -c executable
- find .dub/build/ -type f | grep -v '\.o' | xargs -I '{}' install -v -Dm755 '{}' /app/tools/DLang/bin
- name: finalize
buildsystem: simple
build-commands:
- cd /app/tools/DLang && mv bin bin_ && mkdir bin && cp -ra bin_/. bin/. && rm -rf bin_
- find /app/tools/DLang/bin -type f -exec strip \{\} \;
- mv /app/tools/DLang/lib /app/tools/DLang/lib_ && mkdir -p /app/tools/DLang/lib && cp -ra /app/tools/DLang/lib_/. /app/tools/DLang/lib/. && rm -rf /app/tools/DLang/lib_
- find /app/tools/DLang/lib -type f -iname '*.so' -exec strip \{\} \;
- mv /app/tools/DLang/libexec /app/tools/DLang/libexec_ && mkdir -p /app/tools/DLang/libexec && cp -ra /app/tools/DLang/libexec_/. /app/tools/DLang/libexec/. && rm -rf /app/tools/DLang/libexec_
- find /app/tools/DLang/libexec -type f -exec strip \{\} \;