From 5cf561347f02e0c86cef6e98d58afd5c81ba9b05 Mon Sep 17 00:00:00 2001 From: Marko Semet Date: Sat, 4 Jan 2020 21:10:09 +0100 Subject: [PATCH] Add Plattform 1 --- Platform-v1.0/Wine-i386.yaml | 27 +++- Platform-v1.0/Wine-staging-i386.yaml | 66 +++++++++ Platform-v1.0/Wine-staging-x86_64.yaml | 82 +++++++++++ Platform-v1.0/Wine-x86_64.yaml | 41 +++++- Platform-v1.0/_gen_script.sh | 15 ++ Platform-v1.0/build.sh | 32 ----- Platform-v1.0/gen_script.sh | 31 +++++ Platform-v1.0/list.sh | 16 +++ Platform-v1.0/sources.sh | 184 +++++++++++++++++++++++++ Platform-v1.0/wine/4.13-staging.yaml | 72 ---------- Platform-v1.0/wine/4.13.yaml | 58 -------- Platform-v1.0/wine/4.15-staging.yaml | 72 ---------- Platform-v1.0/wine/4.15.yaml | 58 -------- build.sh | 7 + build_all_in_tmp.sh | 17 +++ build_in_tmp.sh | 35 +++++ export.sh | 11 ++ hash_modules.py | 149 ++++++++++++++++++++ latest.sh | 16 ++- list.sh | 62 +++++++++ 20 files changed, 750 insertions(+), 301 deletions(-) create mode 100644 Platform-v1.0/Wine-staging-i386.yaml create mode 100644 Platform-v1.0/Wine-staging-x86_64.yaml create mode 100755 Platform-v1.0/_gen_script.sh delete mode 100755 Platform-v1.0/build.sh create mode 100755 Platform-v1.0/gen_script.sh create mode 100755 Platform-v1.0/list.sh create mode 100644 Platform-v1.0/sources.sh delete mode 100644 Platform-v1.0/wine/4.13-staging.yaml delete mode 100644 Platform-v1.0/wine/4.13.yaml delete mode 100644 Platform-v1.0/wine/4.15-staging.yaml delete mode 100644 Platform-v1.0/wine/4.15.yaml create mode 100755 build.sh create mode 100755 build_all_in_tmp.sh create mode 100755 build_in_tmp.sh create mode 100755 export.sh create mode 100755 hash_modules.py create mode 100755 list.sh diff --git a/Platform-v1.0/Wine-i386.yaml b/Platform-v1.0/Wine-i386.yaml index 0f53a4a..7d9ed14 100644 --- a/Platform-v1.0/Wine-i386.yaml +++ b/Platform-v1.0/Wine-i386.yaml @@ -3,7 +3,7 @@ writable-sdk: true id: de.marko10_000.winebarrels.WineSdk id-platform: de.marko10_000.winebarrels.Wine -branch: "WINE_BRANCH" +branch: "{{WINE_BRANCH}}" sdk: de.marko10_000.winebarrels.Sdk runtime: de.marko10_000.winebarrels.Platform @@ -18,7 +18,7 @@ inherit-extensions: - org.gtk.Gtk3theme - org.freedesktop.Platform.VAAPI.Intel - org.freedesktop.Platform.html5-codecs - - de.marko10_000.winebarrels.Platform.ExtensionsV1_0 + - de.marko10_000.winebarrels.Platform.ExtensionsV1 modules: - name: test-arch @@ -27,7 +27,28 @@ modules: - false skip-arches: - "i386" - - wine/WINE_VERSION.yaml + - name: wine + sources: + - type: archive + url: {{WINE_SOURCE}} + sha256: {{WINE_SOURCE_SHA256}} + buildsystem: simple + build-commands: + - mkdir -p build/32 + - cd build/32; ../../configure + --prefix=/usr + --libdir=/usr/lib + --with-x + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS + + - make -C build/32 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - rm -rf /usr/tmp_wine/usr/share/man + - cp -arfv /usr/tmp_wine/usr/* /usr + - rm -rf /usr/tmp_wine cleanup: - /share/man diff --git a/Platform-v1.0/Wine-staging-i386.yaml b/Platform-v1.0/Wine-staging-i386.yaml new file mode 100644 index 0000000..711bd40 --- /dev/null +++ b/Platform-v1.0/Wine-staging-i386.yaml @@ -0,0 +1,66 @@ +build-runtime: true +writable-sdk: true + +id: de.marko10_000.winebarrels.WineSdk +id-platform: de.marko10_000.winebarrels.Wine +branch: "{{WINE_BRANCH}}" + +sdk: de.marko10_000.winebarrels.Sdk +runtime: de.marko10_000.winebarrels.Platform +runtime-version: "v1.0" +separate-locales: false + +inherit-extensions: + - org.freedesktop.Platform.GL + - org.freedesktop.Platform.Timezones + - org.freedesktop.Platform.GStreamer + - org.freedesktop.Platform.Icontheme + - org.gtk.Gtk3theme + - org.freedesktop.Platform.VAAPI.Intel + - org.freedesktop.Platform.html5-codecs + - de.marko10_000.winebarrels.Platform.ExtensionsV1 + +modules: + - name: test-arch + buildsystem: simple + build-commands: + - false + skip-arches: + - "i386" + - name: wine + sources: + - type: archive + url: {{WINE_SOURCE}} + sha256: {{WINE_SOURCE_SHA256}} + - type: archive + url: {{WINE_SOURCE_STAGING}} + sha256: {{WINE_SOURCE_STAGING_SHA256}} + dest: wine-staging-patches + - type: shell + commands: + - wine-staging-patches/patches/patchinstall.sh --all + buildsystem: simple + build-commands: + - mkdir -p build/32 + - cd build/32; ../../configure + --prefix=/usr + --libdir=/usr/lib + --with-x + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS + + - make -C build/32 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - rm -rf /usr/tmp_wine/usr/share/man + - cp -arfv /usr/tmp_wine/usr/* /usr + - rm -rf /usr/tmp_wine + +cleanup: + - /share/man + +cleanup-platform: + - /include + - "*.a" + - "*.la" diff --git a/Platform-v1.0/Wine-staging-x86_64.yaml b/Platform-v1.0/Wine-staging-x86_64.yaml new file mode 100644 index 0000000..1be3e94 --- /dev/null +++ b/Platform-v1.0/Wine-staging-x86_64.yaml @@ -0,0 +1,82 @@ +build-runtime: true +writable-sdk: true + +id: de.marko10_000.winebarrels.WineSdk +id-platform: de.marko10_000.winebarrels.Wine +branch: "{{WINE_BRANCH}}" + +sdk: de.marko10_000.winebarrels.Sdk +runtime: de.marko10_000.winebarrels.Platform +runtime-version: "v1.0" +separate-locales: false + +inherit-extensions: + - org.freedesktop.Platform.GL + - org.freedesktop.Platform.Timezones + - org.freedesktop.Platform.GStreamer + - org.freedesktop.Platform.Icontheme + - org.gtk.Gtk3theme + - org.freedesktop.Platform.VAAPI.Intel + - org.freedesktop.Platform.html5-codecs + - org.freedesktop.Platform.GL32 + - de.marko10_000.winebarrels.Platform.ExtensionsV1 + +modules: + - name: test-arch + buildsystem: simple + build-commands: + - false + skip-arches: + - x86_64 + - name: wine + sources: + - type: archive + url: "{{WINE_SOURCE}}" + sha256: "{{WINE_SOURCE_SHA256}}" + - type: archive + url: "{{WINE_SOURCE_STAGING}}" + sha256: "{{WINE_SOURCE_STAGING_SHA256}}" + dest: wine-staging-patches + - type: shell + commands: + - wine-staging-patches/patches/patchinstall.sh --all + buildsystem: simple + build-commands: + - mkdir -p build/64 + - cd build/64; ../../configure + --prefix=/usr + --libdir=/usr/lib + --with-x + --enable-win64 + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS + + - mkdir -p build/32 + - cd build/32; ../../configure + --prefix=/usr + --libdir=/usr/lib32 + --with-x + --with-wine64=../64 + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS + + - make -C build/32 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - make -C build/64 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - rm -rf /usr/tmp_wine/usr/share/man + - cp -arvP --remove-destination /usr/tmp_wine/usr/* /usr + - rm -rf /usr/tmp_wine + +cleanup: + - /share/man + +cleanup-platform: + - /include + - "*.a" + - "*.la" + - /lib/ccache diff --git a/Platform-v1.0/Wine-x86_64.yaml b/Platform-v1.0/Wine-x86_64.yaml index 0be8d79..78b17df 100644 --- a/Platform-v1.0/Wine-x86_64.yaml +++ b/Platform-v1.0/Wine-x86_64.yaml @@ -3,7 +3,7 @@ writable-sdk: true id: de.marko10_000.winebarrels.WineSdk id-platform: de.marko10_000.winebarrels.Wine -branch: "WINE_BRANCH" +branch: "{{WINE_BRANCH}}" sdk: de.marko10_000.winebarrels.Sdk runtime: de.marko10_000.winebarrels.Platform @@ -19,7 +19,7 @@ inherit-extensions: - org.freedesktop.Platform.VAAPI.Intel - org.freedesktop.Platform.html5-codecs - org.freedesktop.Platform.GL32 - - de.marko10_000.winebarrels.Platform.ExtensionsV1_0 + - de.marko10_000.winebarrels.Platform.ExtensionsV1 modules: - name: test-arch @@ -28,7 +28,42 @@ modules: - false skip-arches: - x86_64 - - wine/WINE_VERSION.yaml + - name: wine + sources: + - type: archive + url: {{WINE_SOURCE}} + sha256: {{WINE_SOURCE_SHA256}} + buildsystem: simple + build-commands: + - mkdir -p build/64 + - cd build/64; ../../configure + --prefix=/usr + --libdir=/usr/lib + --with-x + --enable-win64 + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS + + - mkdir -p build/32 + - cd build/32; ../../configure + --prefix=/usr + --libdir=/usr/lib32 + --with-x + --with-wine64=../64 + CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 + CC=ccache\ gcc + CPP=ccache\ cpp + - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS + + - make -C build/32 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - make -C build/64 DESTDIR=/usr/tmp_wine install -j$FLATPAK_BUILDER_N_JOBS + - rm -rf /usr/tmp_wine/usr/share/man + - cp -arvP --remove-destination /usr/tmp_wine/usr/* /usr + - rm -rf /usr/tmp_wine cleanup: - /share/man diff --git a/Platform-v1.0/_gen_script.sh b/Platform-v1.0/_gen_script.sh new file mode 100755 index 0000000..e2603af --- /dev/null +++ b/Platform-v1.0/_gen_script.sh @@ -0,0 +1,15 @@ +#! /usr/bin/env bash +# Args: + +CONFIG_DIR="`dirname \"$0\"`" && +cp -f "$CONFIG_DIR/$1" "$2" && +WINE_BRANCH="`echo \"$3\" | sed -e 's:/:\\\\/:g'`" && +WINE_SOURCE="`echo \"$4\" | sed -e 's:/:\\\\/:g'`" && +WINE_SOURCE_SHA256="`echo \"$5\" | sed -e 's:/:\\\\/:g'`" && +WINE_SOURCE_STAGING="`echo \"$6\" | sed -e 's:/:\\\\/:g'`" && +WINE_SOURCE_STAGING_SHA256="`echo \"$7\" | sed -e 's:/:\\\\/:g'`" && +sed -i -e "s/{{WINE_BRANCH}}/$WINE_BRANCH/g" "$2" && +sed -i -e "s/{{WINE_SOURCE}}/$WINE_SOURCE/g" "$2" && +sed -i -e "s/{{WINE_SOURCE_SHA256}}/$WINE_SOURCE_SHA256/g" "$2" && +sed -i -e "s/{{WINE_SOURCE_STAGING}}/$WINE_SOURCE_STAGING/g" "$2" && +sed -i -e "s/{{WINE_SOURCE_STAGING_SHA256}}/$WINE_SOURCE_STAGING_SHA256/g" "$2" diff --git a/Platform-v1.0/build.sh b/Platform-v1.0/build.sh deleted file mode 100755 index 045ccda..0000000 --- a/Platform-v1.0/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -CONFIG_PATH="`dirname $0`" || exit 1 -if [ ! -z "$4" ]; then - BRANCH="$4" -else - BRANCH="$1" -fi - -if [ -z "$NO_32BIT" ]; then - cp -f "$CONFIG_PATH/Wine-i386.yaml" "$CONFIG_PATH/tmp-i386.yaml" && - sed -i -e "s/WINE_VERSION/$1/" "$CONFIG_PATH/tmp-i386.yaml" && - sed -i -e "s/WINE_BRANCH/$BRANCH/" "$CONFIG_PATH/tmp-i386.yaml" || exit 2 - - if [ -z $3 ]; then - flatpak-builder $2 --ccache --arch=i386 build32 "$CONFIG_PATH/tmp-i386.yaml" || exit 2 - else - flatpak-builder $2 --ccache --arch=i386 --gpg-sign=winebarrels@marko10-000.de "--repo=$3" build32 "$CONFIG_PATH/tmp-i386.yaml" || exit 2 - fi -fi - -if [ -z "$NO_64BIT" ]; then - cp -f "$CONFIG_PATH/Wine-x86_64.yaml" "$CONFIG_PATH/tmp-x86_64.yaml" && - sed -i -e "s/WINE_VERSION/$1/" "$CONFIG_PATH/tmp-x86_64.yaml" && - sed -i -e "s/WINE_BRANCH/$BRANCH/" "$CONFIG_PATH/tmp-x86_64.yaml" || exit 3 - - if [ -z $3 ]; then - flatpak-builder $2 --ccache --arch=x86_64 build64 "$CONFIG_PATH/tmp-x86_64.yaml" || exit 3 - else - flatpak-builder $2 --ccache --arch=x86_64 --gpg-sign=winebarrels@marko10-000.de "--repo=$3" build64 "$CONFIG_PATH/tmp-x86_64.yaml" || exit 3 - fi -fi diff --git a/Platform-v1.0/gen_script.sh b/Platform-v1.0/gen_script.sh new file mode 100755 index 0000000..03f0852 --- /dev/null +++ b/Platform-v1.0/gen_script.sh @@ -0,0 +1,31 @@ +#! /usr/bin/env bash +# Args: + +# Find arch +if [[ "$1" == "i386" ]] +then + ARCH="i386" +elif [[ "$1" == "x86_64" ]] +then + ARCH="x86_64" +else + (>&1 echo "Unkown arch $1.") || exit 1 +fi + +# Find file +if [[ "$2" == *-staging ]] +then + SOURCE_FILE="Wine-staging-$ARCH.yaml" + ARG_VERSION="${2::-8}" +else + SOURCE_FILE="Wine-$ARCH.yaml" + ARG_VERSION="$2" +fi + +CONFIG_DIR="`dirname \"$0\"`" && +source "$CONFIG_DIR/sources.sh" && +VERSION=`echo "WINE_$ARG_VERSION" | sed -e "s/\\./_/g" | sed -e "s/-/_/g"` && +VERSION_SHA256="${VERSION}_SHA256" && +VERSION_STAGING="${VERSION}_STAGING" && +VERSION_STAGING_SHA256="${VERSION}_STAGING_SHA256" && +exec "$CONFIG_DIR/_gen_script.sh" "$SOURCE_FILE" "$3" "$2" "${!VERSION}" "${!VERSION_SHA256}" "${!VERSION_STAGING}" "${!VERSION_STAGING_SHA256}" diff --git a/Platform-v1.0/list.sh b/Platform-v1.0/list.sh new file mode 100755 index 0000000..b19a387 --- /dev/null +++ b/Platform-v1.0/list.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +CONFIG_DIR="`dirname \"$0\"`" && +source "$CONFIG_DIR/sources.sh" && +for i in `printenv | sed 's/=.*//' | sort | grep 'WINE_.*_NAME'` +do + i="WINE_${i:5:-5}_NAME" + echo "i386" "${!i}" + echo "x86_64" "${!i}" + iid="WINE_$(echo "${!i}" | sed -e 's/\./_/g' | sed -e 's/-/_/g')_STAGING" + if [[ ! -z "${!iid}" ]] + then + echo "i386" "${!i}-staging" + echo "x86_64" "${!i}-staging" + fi +done diff --git a/Platform-v1.0/sources.sh b/Platform-v1.0/sources.sh new file mode 100644 index 0000000..e6ffcbd --- /dev/null +++ b/Platform-v1.0/sources.sh @@ -0,0 +1,184 @@ +# ******************* +# * 4.0 * +# ******************* +export WINE_4_0_NAME='4.0' +export WINE_4_0='https://dl.winehq.org/wine/source/4.0/wine-4.0.tar.xz' +export WINE_4_0_SHA256='6736cdee95b2b8bb021ec0c19497ed8cad5ae2c8bfdb7ab5dc687ff92a480d4d' +export WINE_4_0_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.0.tar.gz' +export WINE_4_0_STAGING_SHA256='12f7d1e46f06ed56b4b409b7f40e47622d84262e7e78cfc02f19c0cdd8b03788' + +# 4.0.1 +export WINE_4_0_1_NAME='4.0.1' +export WINE_4_0_1='https://dl.winehq.org/wine/source/4.0/wine-4.0.1.tar.xz' +export WINE_4_0_1_SHA256='d3a692f04c2fe03c8bd856655eaf4e6eeb4ad47f7d3120898dbf997e816b4948' + +# 4.0.2 +export WINE_4_0_2_NAME='4.0.2' +export WINE_4_0_2='https://dl.winehq.org/wine/source/4.0/wine-4.0.2.tar.xz' +export WINE_4_0_2_SHA256='994050692f8417ee206daafa5fc0ff810cc9392ffda1786ac0f0fb0cf74dbd74' + +# 4.0.3 +export WINE_4_0_3_NAME='4.0.3' +export WINE_4_0_3='https://dl.winehq.org/wine/source/4.0/wine-4.0.3.tar.xz' +export WINE_4_0_3_SHA256='25026d9f98a5d62583b8a02c91b1adaca9a2ff000d54095bb274045379e00fda' + +# 4.1 +export WINE_4_1_NAME='4.1' +export WINE_4_1='https://dl.winehq.org/wine/source/4.x/wine-4.1.tar.xz' +export WINE_4_1_SHA256='cef775be05245ebd0f8a5fd50920c6c7d0a6539b781d8185d6c16b8e5ae41bad' +export WINE_4_1_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.1-2.tar.gz' +export WINE_4_1_STAGING_SHA256='e652e19da60fbd5739d7fc5b245f74a34dbf2059d9a20e846dd7c778b800444d' + +# 4.2 +export WINE_4_2_NAME='4.2' +export WINE_4_2='https://dl.winehq.org/wine/source/4.x/wine-4.2.tar.xz' +export WINE_4_2_SHA256='a1d141f5f8dabb51475f21f90c63b6521c233fcf34ebcbe311f9c0eda5c05bfb' +export WINE_4_2_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.2.tar.gz' +export WINE_4_2_STAGING_SHA256='011f58ceb9f45a7f0c067052b4ea5c79a04af30112ba30a96c49d2f09447ccd8' + +# 4.3 +export WINE_4_3_NAME='4.3' +export WINE_4_3='https://dl.winehq.org/wine/source/4.x/wine-4.3.tar.xz' +export WINE_4_3_SHA256='3db9b50f061087e7ec115a47e44d662a5b8a7fdb44264e637795508a185f0fb4' +export WINE_4_3_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.3.tar.gz' +export WINE_4_3_STAGING_SHA256='8fb6ca7f8c2c6eaf7aa1397d5711b93eb1092e16580bb850d54388f6add69875' + +# 4.4 +export WINE_4_4_NAME='4.4' +export WINE_4_4='https://dl.winehq.org/wine/source/4.x/wine-4.4.tar.xz' +export WINE_4_4_SHA256='db3a09cf4b0b4329ffed8014073c9868b5ecb4826adfb4a91aa49bd2841207b0' +export WINE_4_4_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.4.tar.gz' +export WINE_4_4_STAGING_SHA256='83de1def6167e79418527a8d120e70cc2904889a47b10b1a21f26bfc26edc306' + +# 4.5 +export WINE_4_5_NAME='4.5' +export WINE_4_5='https://dl.winehq.org/wine/source/4.x/wine-4.5.tar.xz' +export WINE_4_5_SHA256='5ff2d7155f9a9951ec93e50c31ef633b16be376b8b78946d177727ce8ed8c1b7' +export WINE_4_5_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.5.tar.gz' +export WINE_4_5_STAGING_SHA256='fb257f490dd633988bafb5e34e748bd787d5b8760d540ba8ed8103596ab05110' + +# 4.6 +export WINE_4_6_NAME='4.6' +export WINE_4_6='https://dl.winehq.org/wine/source/4.x/wine-4.6.tar.xz' +export WINE_4_6_SHA256='329001f924d3f825121a1b28cae8e36515405f2a1d22bc266897d3d926b562da' +export WINE_4_6_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.6.tar.gz' +export WINE_4_6_STAGING_SHA256='c9164ef486b3a0b947251910318de6fffb7fdcd8c311ec8ccca5dab399700592' + +# 4.7 +export WINE_4_7_NAME='4.7' +export WINE_4_7='https://dl.winehq.org/wine/source/4.x/wine-4.7.tar.xz' +export WINE_4_7_SHA256='3bca9084354a60d202f6b8e670b130366126db0583fa27054f1f02294de7bab0' +export WINE_4_7_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.7.tar.gz' +export WINE_4_7_STAGING_SHA256='3199e75e5085ab742280ef4f924205af977a2b5cb8d8051419d97d274545ef6f' + +# 4.8 +export WINE_4_8_NAME='4.8' +export WINE_4_8='https://dl.winehq.org/wine/source/4.x/wine-4.8.tar.xz' +export WINE_4_8_SHA256='48b9ab1c1277e13eede66e1af1f9f885cb8b4c5cb53eea6ebbfe10bc06dfa135' +export WINE_4_8_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.8.tar.gz' +export WINE_4_8_STAGING_SHA256='880170682119a539ca51c5e8c188f3896f4d5d8a295d0d0fd03d23ed79372415' + +# 4.9 +export WINE_4_9_NAME='4.9' +export WINE_4_9='https://dl.winehq.org/wine/source/4.x/wine-4.9.tar.xz' +export WINE_4_9_SHA256='91848e22fff3cb17db7fe7d727d714d21c5d4229dd460b5d1506753021fc799b' +export WINE_4_9_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.9.tar.gz' +export WINE_4_9_STAGING_SHA256='93dcf54754c34c2a34aeac4e42b654b69dd804731c0049a0a1b12295adc8f4b7' + +# 4.10 +export WINE_4_10_NAME='4.10' +export WINE_4_10='https://dl.winehq.org/wine/source/4.x/wine-4.10.tar.xz' +export WINE_4_10_SHA256='5add8161d8b73a413b011285951bed28602ebb0b5b257f35d40bc782ea1c2d10' +export WINE_4_10_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.10.tar.gz' +export WINE_4_10_STAGING_SHA256='a0acca3976f9c68d348099916987b403ffd513d5182b19600bd2a6ebed78c5c0' + +# 4.11 +export WINE_4_11_NAME='4.11' +export WINE_4_11='https://dl.winehq.org/wine/source/4.x/wine-4.11.tar.xz' +export WINE_4_11_SHA256='2e515766d59d3afdfd5f8d0eb29eb1d1d4ae84969c0a7a7eb4427feb2977bee6' +export WINE_4_11_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.11.tar.gz' +export WINE_4_11_STAGING_SHA256='b51f70d25c89279bb3752938d9fb4f3f281742f642bf139703768cc524c6fde0' + +# 4.12 +export WINE_4_12_NAME='4.12' +export WINE_4_12='https://dl.winehq.org/wine/source/4.x/wine-4.12.tar.xz' +export WINE_4_12_SHA256='00125c50b12363a4accd884de9463dc769601372ffbde6360bf40bfc19bbe5ab' +export WINE_4_12_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.12.tar.gz' +export WINE_4_12_STAGING_SHA256='54507d60037612a4746b0c37382bbec1e5beed1b832449f10cec08ffb88af3b0' + +# 4.12.1 +export WINE_4_12_1_NAME='4.12.1' +export WINE_4_12_1='https://dl.winehq.org/wine/source/4.x/wine-4.12.1.tar.xz' +export WINE_4_12_1_SHA256='a0cf2d6925c60344367e0197760c84be738c56c50d559ac20cc19330c572d227' +export WINE_4_12_1_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.12.1.tar.gz' +export WINE_4_12_1_STAGING_SHA256='0efe47f2305c8f45aea403173c7cfba9adeae47940b218efa2a1916a69342906' + +# 4.13 +export WINE_4_13_NAME='4.13' +export WINE_4_13='https://dl.winehq.org/wine/source/4.x/wine-4.13.tar.xz' +export WINE_4_13_SHA256='79174151cbc403250d4727dc9c55df8d6a60a2fe28343642c2452a92c6431d67' +export WINE_4_13_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.13.tar.gz' +export WINE_4_13_STAGING_SHA256='e9b01570092c2e7659119e0ff5d71e7733209b47b065495c073332c0bbe906a3' + +# 4.14 +export WINE_4_14_NAME='4.14' +export WINE_4_14='https://dl.winehq.org/wine/source/4.x/wine-4.14.tar.xz' +export WINE_4_14_SHA256='dad56e090c7466d10fdce72cb379b7acc366159fc8b46058f710645de65081e6' +export WINE_4_14_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.14.tar.gz' +export WINE_4_14_STAGING_SHA256='d25ca6fa48b0a2ed812b4d72c4939c52937c3df2d4518061e2c2899655865c73' + +# 4.15 +export WINE_4_15_NAME='4.15' +export WINE_4_15='https://dl.winehq.org/wine/source/4.x/wine-4.15.tar.xz' +export WINE_4_15_SHA256='f8797587a7ecc9205c7d269eabb4b5b56ed700d2fb2310883b92ff94da26d02d' +export WINE_4_15_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.15-1.tar.gz' +export WINE_4_15_STAGING_SHA256='ca6a0910c45f5ef651a018cedd4cde3094bee7d139bc0aa85173fd8e567ca581' + +# 4.16 +export WINE_4_16_NAME='4.16' +export WINE_4_16='https://dl.winehq.org/wine/source/4.x/wine-4.16.tar.xz' +export WINE_4_16_SHA256='8d7ba7a0643626c0349442577a1f1b06d3062a4129aac0bd5a2b0eb15b5b1d9f' +export WINE_4_16_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.16.tar.gz' +export WINE_4_16_STAGING_SHA256='2de237fa5d9eeb3a67f75e113f392a2b53a67d75f1d1f6304964013c837f93b9' + +# 4.17 +export WINE_4_17_NAME='4.17' +export WINE_4_17='https://dl.winehq.org/wine/source/4.x/wine-4.17.tar.xz' +export WINE_4_17_SHA256='7480a1436687486996ba6cf91fef71b70e6dafffbf2c55ea2430094c1025b2ae' +export WINE_4_17_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.17.tar.gz' +export WINE_4_17_STAGING_SHA256='8c7ec7ca44641930d990286305bcfd6b027566d608ca9e3e9d7accff39d53a39' + +# 4.18 +export WINE_4_18_NAME='4.18' +export WINE_4_18='https://dl.winehq.org/wine/source/4.x/wine-4.18.tar.xz' +export WINE_4_18_SHA256='d10b0550215f789655a1c67db91a8afc0b4284416bae1869396f06e2db360e32' +export WINE_4_18_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.18.tar.gz' +export WINE_4_18_STAGING_SHA256='e34c0047004ac7ade8e55c273c8ecf0fa201a22f9fb1ab332c9e0a638e5089d0' + +# 4.19 +export WINE_4_19_NAME='4.19' +export WINE_4_19='https://dl.winehq.org/wine/source/4.x/wine-4.19.tar.xz' +export WINE_4_19_SHA256='361abeebb676c65acafdb2bcdc96a7fbd2a7bc8689f7bebbcca97d8ca069ce20' +export WINE_4_19_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.19.tar.gz' +export WINE_4_19_STAGING_SHA256='4538a986c1df700c4071d4044937f216c82eb6f73f3c19a9c00d909dda6cb05a' + +# 4.20 +export WINE_4_20_NAME='4.20' +export WINE_4_20='https://dl.winehq.org/wine/source/4.x/wine-4.20.tar.xz' +export WINE_4_20_SHA256='60a0060bf7ac13948d55d8637b5c1d0b3ba11ff236bf5a084b557247ca2698d3' +export WINE_4_20_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.20.tar.gz' +export WINE_4_20_STAGING_SHA256='09a793c437af018421c3aa58daf0ac99661476f1fbc8740fa7e20d1c2c85093e' + +# 4.21 +export WINE_4_21_NAME='4.21' +export WINE_4_21='https://dl.winehq.org/wine/source/4.x/wine-4.21.tar.xz' +export WINE_4_21_SHA256='324ce14a70059835f33d293f0740b1bf0366bc6b5514548bc083d89b44744ad0' +export WINE_4_21_STAGING='https://github.com/wine-staging/wine-staging/archive/v4.21.tar.gz' +export WINE_4_21_STAGING_SHA256='6b1e2803ea81d918a1f4cd49dddab0e89d39d8762f0e357e296a379fe3fb9960' + +# Template +# export WINE_4_*_NAME='*' +# export WINE_4_*='' +# export WINE_4_*_SHA256='' +# export WINE_4_*_STAGING='' +# export WINE_4_*_STAGING_SHA256='' diff --git a/Platform-v1.0/wine/4.13-staging.yaml b/Platform-v1.0/wine/4.13-staging.yaml deleted file mode 100644 index f373585..0000000 --- a/Platform-v1.0/wine/4.13-staging.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: wine-meta -modules: - - name: wine-64bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.13.tar.xz - sha256: 79174151cbc403250d4727dc9c55df8d6a60a2fe28343642c2452a92c6431d67 - - type: archive - url: https://github.com/wine-staging/wine-staging/archive/v4.13.tar.gz - sha256: e9b01570092c2e7659119e0ff5d71e7733209b47b065495c073332c0bbe906a3 - dest: wine-staging-patches - - type: shell - commands: - - wine-staging-patches/patches/patchinstall.sh --all - buildsystem: simple - only-arches: - - x86_64 - build-commands: - - mkdir -p build/64 - - cd build/64; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - --enable-win64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS - - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib32 - --with-x - --with-wine64=../64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - make -C build/64 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine - - name: wine-32bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.13.tar.xz - sha256: 79174151cbc403250d4727dc9c55df8d6a60a2fe28343642c2452a92c6431d67 - - type: archive - url: https://github.com/wine-staging/wine-staging/archive/v4.13.tar.gz - sha256: e9b01570092c2e7659119e0ff5d71e7733209b47b065495c073332c0bbe906a3 - dest: wine-staging-patches - - type: shell - commands: - - wine-staging-patches/patches/patchinstall.sh --all - buildsystem: simple - only-arches: - - i386 - build-commands: - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine diff --git a/Platform-v1.0/wine/4.13.yaml b/Platform-v1.0/wine/4.13.yaml deleted file mode 100644 index 0845e8e..0000000 --- a/Platform-v1.0/wine/4.13.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: wine-meta -modules: - - name: wine-64bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.13.tar.xz - sha256: 79174151cbc403250d4727dc9c55df8d6a60a2fe28343642c2452a92c6431d67 - buildsystem: simple - only-arches: - - x86_64 - build-commands: - - mkdir -p build/64 - - cd build/64; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - --enable-win64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS - - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib32 - --with-x - --with-wine64=../64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - make -C build/64 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine - - name: wine-32bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.13.tar.xz - sha256: 79174151cbc403250d4727dc9c55df8d6a60a2fe28343642c2452a92c6431d67 - buildsystem: simple - only-arches: - - i386 - build-commands: - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine diff --git a/Platform-v1.0/wine/4.15-staging.yaml b/Platform-v1.0/wine/4.15-staging.yaml deleted file mode 100644 index 295b9e2..0000000 --- a/Platform-v1.0/wine/4.15-staging.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: wine-meta -modules: - - name: wine-64bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.15.tar.xz - sha256: f8797587a7ecc9205c7d269eabb4b5b56ed700d2fb2310883b92ff94da26d02d - - type: archive - url: https://github.com/wine-staging/wine-staging/archive/v4.15-1.tar.gz - sha256: ca6a0910c45f5ef651a018cedd4cde3094bee7d139bc0aa85173fd8e567ca581 - dest: wine-staging-patches - - type: shell - commands: - - wine-staging-patches/patches/patchinstall.sh --all - buildsystem: simple - only-arches: - - x86_64 - build-commands: - - mkdir -p build/64 - - cd build/64; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - --enable-win64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS - - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib32 - --with-x - --with-wine64=../64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - make -C build/64 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine - - name: wine-32bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.15.tar.xz - sha256: f8797587a7ecc9205c7d269eabb4b5b56ed700d2fb2310883b92ff94da26d02d - - type: archive - url: https://github.com/wine-staging/wine-staging/archive/v4.15-1.tar.gz - sha256: ca6a0910c45f5ef651a018cedd4cde3094bee7d139bc0aa85173fd8e567ca581 - dest: wine-staging-patches - - type: shell - commands: - - wine-staging-patches/patches/patchinstall.sh --all - buildsystem: simple - only-arches: - - i386 - build-commands: - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine diff --git a/Platform-v1.0/wine/4.15.yaml b/Platform-v1.0/wine/4.15.yaml deleted file mode 100644 index 6f8ceca..0000000 --- a/Platform-v1.0/wine/4.15.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: wine-meta -modules: - - name: wine-64bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.15.tar.xz - sha256: f8797587a7ecc9205c7d269eabb4b5b56ed700d2fb2310883b92ff94da26d02d - buildsystem: simple - only-arches: - - x86_64 - build-commands: - - mkdir -p build/64 - - cd build/64; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - --enable-win64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/64 -j$FLATPAK_BUILDER_N_JOBS - - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib32 - --with-x - --with-wine64=../64 - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - make -C build/64 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine - - name: wine-32bit - sources: - - type: archive - url: https://dl.winehq.org/wine/source/4.x/wine-4.15.tar.xz - sha256: f8797587a7ecc9205c7d269eabb4b5b56ed700d2fb2310883b92ff94da26d02d - buildsystem: simple - only-arches: - - i386 - build-commands: - - mkdir -p build/32 - - cd build/32; ../../configure - --prefix=/usr - --libdir=/usr/lib - --with-x - CFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - CPPFLAGS=-O2\ -D_FORTIFY_SOURCE=2 - - make -C build/32 -j$FLATPAK_BUILDER_N_JOBS - - - make -C build/32 DESTDIR=/usr/tmp_wine install - - rm -rf /usr/tmp_wine/usr/share/man - - cp -arfv /usr/tmp_wine/usr/* /usr - - rm -rf /usr/tmp_wine diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..cf14700 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#! /usr/bin/env bash +# Args: + +CONFIG_DIR="`dirname \"$0\"`" && +"$CONFIG_DIR/$1/gen_script.sh" "$2" "$3" tmp.yaml && +HASH="`\"\$CONFIG_DIR/hash_modules.py\" tmp.yaml \"\$2\" | sed -n '1p'`" && +flatpak-builder --force-clean "--arch=$2" --gpg-sign=winebarrels@marko10-000.de "--repo=$4" -s "WB_HASH='${HASH}'" build tmp.yaml diff --git a/build_all_in_tmp.sh b/build_all_in_tmp.sh new file mode 100755 index 0000000..e64366f --- /dev/null +++ b/build_all_in_tmp.sh @@ -0,0 +1,17 @@ +#! /usr/bin/env bash +# Args: + +if [ "`whoami`" != "root" ] +then + (>&2 echo Programm has to run as root.) + exit 1 +fi +if [ -z "$SUDO_USER" ] +then + (>&2 echo Programm has to be run as sudo. SUDO_USER not set.) + exit 1 +fi + +CONFIG_DIR="`dirname \"$0\"`" && +echo '' | sudo -u "$SUDO_USER" -v && +REPO="$1" "$CONFIG_DIR/list.sh" "$CONFIG_DIR/build_in_tmp.sh" diff --git a/build_in_tmp.sh b/build_in_tmp.sh new file mode 100755 index 0000000..c7dcbc6 --- /dev/null +++ b/build_in_tmp.sh @@ -0,0 +1,35 @@ +#! /usr/bin/env bash +# Args: + +if [ "`whoami`" != "root" ] +then + (>&2 echo Programm has to run as root.) + exit 1 +fi +if [ -z "$SUDO_USER" ] +then + (>&2 echo Programm has to be run as sudo. SUDO_USER not set.) + exit 1 +fi +if [ "$#" = 4 ] +then + REPO="$4" +fi + +CONFIG_DIR=$(dirname "$0") && +BUILD_DIR=$(sudo -u "$SUDO_USER" -H mktemp -d) && +sudo -u "$SUDO_USER" -H mkdir -p ".flatpak-builder/ccache" && +sudo -u "$SUDO_USER" -H mkdir -p ".flatpak-builder/downloads" && +sudo -u "$SUDO_USER" -H mkdir -p "$BUILD_DIR/.flatpak-builder/ccache" && +sudo -u "$SUDO_USER" -H mkdir -p "$BUILD_DIR/.flatpak-builder/downloads" && +mount --bind ".flatpak-builder/ccache" "$BUILD_DIR/.flatpak-builder/ccache" && +mount --bind ".flatpak-builder/downloads" "$BUILD_DIR/.flatpak-builder/downloads" && +cd "$BUILD_DIR" && +sudo -u "$SUDO_USER" -H "$CONFIG_DIR/build.sh" "$1" "$2" "$3" "$REPO" + +RESULT=$! +umount "$BUILD_DIR/.flatpak-builder/ccache" && +umount "$BUILD_DIR/.flatpak-builder/downloads" && +cd && +rm -rf "$BUILD_DIR" +exit $RESULT diff --git a/export.sh b/export.sh new file mode 100755 index 0000000..ad64533 --- /dev/null +++ b/export.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +list=$(ostree refs --repo "$1" | sort) +counts=$(echo "$list" | wc -l) +index=1 +for i in $list +do + echo "Move($index/$counts): $i" + index=$(expr $index + 1) + flatpak build-commit-from --src-repo "$1" --src-ref "$i" --disable-fsync --no-update-summary --gpg-sign=winebarrels@marko10-000.de "$2" "$i" +done diff --git a/hash_modules.py b/hash_modules.py new file mode 100755 index 0000000..190ead5 --- /dev/null +++ b/hash_modules.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 +import hashlib +import json +import os +import re +import subprocess +import yaml + + +def _load_stdout(args): + p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + result = p.stdout.read() + if p.returncode != 0: + raise RuntimeError("Process crashed with " + repr(p.returncode) + + ". Args: " + repr(args)) + return result + + +_moduleFiles = {} + + +class ModuleLoader(): + path = str + content = dict + __hash_find = re.compile(".*WB_HASH\\=\\'(?P[a-zA-Z0-9]*)\\'.*") + + def __module(self, modules): + for iID in range(len(modules)): + i = modules[iID] + if isinstance(i, str): + i = self.relative(i) + if i in _moduleFiles: + tmp = _moduleFiles[i] + else: + tmp = ModuleLoader(i) + modules[iID] = tmp.content + else: + if "modules" in i: + self.__module(i["modules"]) + + def __init__(self, source): + if not isinstance(source, str): + raise ValueError("source have to be string. It was a " + + repr(source) + ".") + self.path = os.path.abspath(source) + _moduleFiles[self.path] = self + self.content = yaml.load(open(self.path, "r").read(), + Loader=yaml.SafeLoader) + if "modules" in self.content: + self.__module(self.content["modules"]) + + def hash(self, function): + tmp = json.dumps(self.content, skipkeys=False, ensure_ascii=True, + check_circular=True, allow_nan=True, indent=None, + separators=("", ""), default=None, sort_keys=True) + tmp = tmp.encode("utf-8") + return function(tmp) + + def gen_base_version(self, arch): + version = self.content["runtime-version"] + sdk = _load_stdout(["flatpak", "info", "-c", "--arch=" + arch, + "--user", self.content["sdk"], version]) + platform = _load_stdout(["flatpak", "info", "-c", "--arch=" + arch, + "--user", self.content["runtime"], version]) + sdk = sdk.splitlines()[0] + platform = platform.splitlines()[0] + return sdk, platform + + def get_depends(self, arch): + version_src = "/" + arch + "/" + self.content["runtime-version"] + version_target = "/" + arch + "/" + self.content["branch"] + result = [self.content["sdk"] + version_src, + self.content["runtime"] + version_src, + self.content["id"] + version_target, + self.content["id-platform"] + version_target] + return result + + def get_old_hash(self, arch): + vers = self.content["branch"] + try: + hash_sdk = _load_stdout(["flatpak", "info", "--arch=" + arch, + "--user", self.content["id"], vers]) + hash_platform = _load_stdout(["flatpak", "info", "--arch=" + arch, + "--user", + self.content["id-platform"], vers]) + if b"WB_HASH=" in hash_sdk: + hash_sdk = hash_sdk[hash_sdk.find(b"WB_HASH="):] + hash_sdk = self.__hash_find.match(hash_sdk.decode()) + if hash_sdk is None: + hash_sdk = "--None--" + else: + hash_sdk = hash_sdk.groupdict()["hash"] + if b"WB_HASH=" in hash_platform: + hash_platform = hash_platform[hash_platform.find(b"WB_HASH="):] + hash_platform = self.__hash_find.match(hash_platform.decode()) + if hash_platform is None: + hash_platform = "--None--" + else: + hash_platform = hash_platform.groupdict()["hash"] + return hash_sdk, hash_platform + except RuntimeError: + return "--None--", "--None--" + + def relative(self, file): + return os.path.abspath(os.path.join(os.path.split(self.path)[0], file)) + + +def get_hashes(source, arch): + mod = ModuleLoader(source) + parent_ids = b" ".join(mod.gen_base_version(arch)) + b" " + + # Hash config + def hash_methode(hashclass): + def func(data): + tmp = hashclass() + tmp.update(parent_ids) + tmp.update(data) + return tmp.hexdigest() + return func + own = mod.hash(hash_methode(hashlib.sha3_512)).upper() + + # Get old hash + old1, old2 = mod.get_old_hash(args.arch[0]) + return own, old1, old2 + + +def get_depends(source, arch): + mod = ModuleLoader(source) + return mod.get_depends(arch) + + +if __name__ == '__main__': + import argparse + + # Parse config + parser = argparse.ArgumentParser(description="Generate hash of a module.") + parser.add_argument("file", metavar="file", type=str, nargs=1, + help="File configuration to generate hash.") + parser.add_argument("arch", metavar="arch", type=str, nargs=1, + help="The arch to build.") + parser.add_argument("--depends", dest="dependes", action="store_const", + const=True, default=False, help="List source runtime.") + args = parser.parse_args() + + if args.dependes: + print("\n".join(get_depends(args.file[0], args.arch[0]))) + else: + print("\n".join(get_hashes(args.file[0], args.arch[0]))) diff --git a/latest.sh b/latest.sh index b99a9a3..736376c 100755 --- a/latest.sh +++ b/latest.sh @@ -3,18 +3,28 @@ REPO_PATH="$1" function install { - flatpak build-commit-from --gpg-sign=winebarrels@marko10-000.de "--src-repo=$REPO_PATH" "--src-ref=runtime/$1/$2" "$REPO_PATH" "runtime/$1/$3" + echo "Installing: $1/$3" >&2 + flatpak build-commit-from --gpg-sign=winebarrels@marko10-000.de --extra-collection-id=de.marko10_000.Winebarrels --no-update-summary --disable-fsync "--src-repo=$REPO_PATH" "--src-ref=runtime/$1/$2" "$REPO_PATH" "runtime/$1/$3" || ( + ostree commit --repo "$REPO_PATH" --bind-ref="runtime/$1/$2" -b "runtime/$1/$3" --fsync=none --skip-if-unchanged && + flatpak build-commit-from --gpg-sign=winebarrels@marko10-000.de --extra-collection-id=de.marko10_000.Winebarrels --no-update-summary --disable-fsync "--src-repo=$REPO_PATH" "--src-ref=runtime/$1/$2" "$REPO_PATH" -v "runtime/$1/$3" + ) } # # SETTINGS # -LATEST_WINE="4.15" -LATEST_STAGING_WINE="4.15-staging" +STABLE_WINE="4.0.3" +LATEST_WINE="4.21" +LATEST_STAGING_WINE="4.21-staging" # # Install # +install "de.marko10_000.winebarrels.WineSdk" "x86_64/$STABLE_WINE" "x86_64/stable" +install "de.marko10_000.winebarrels.WineSdk" "i386/$STABLE_WINE" "i386/stable" +install "de.marko10_000.winebarrels.Wine" "x86_64/$STABLE_WINE" "x86_64/stable" +install "de.marko10_000.winebarrels.Wine" "i386/$STABLE_WINE" "i386/stable" + install "de.marko10_000.winebarrels.WineSdk" "x86_64/$LATEST_WINE" "x86_64/latest" install "de.marko10_000.winebarrels.WineSdk" "i386/$LATEST_WINE" "i386/latest" install "de.marko10_000.winebarrels.Wine" "x86_64/$LATEST_WINE" "x86_64/latest" diff --git a/list.sh b/list.sh new file mode 100755 index 0000000..c477414 --- /dev/null +++ b/list.sh @@ -0,0 +1,62 @@ +#! /usr/bin/env bash + +# Check user +USE_SUDO=() +if [ "`whoami`" = "root" ] +then + if [ -z "$SUDO_USER" ] + then + (>&2 echo Run as root. SUDO_USER not set.) + exit 1 + fi + (>&2 echo Run processes as "$SUDO_USER.") + USE_SUDO=( sudo "-u" "$SUDO_USER" "-H" ) +fi + +# Get config an command +CONFIG_DIR="`dirname \"$0\"`" +if [ "$#" = 0 ] +then + COMMAND=(echo) +else + COMMAND=$@ +fi + +function run_command { + tmp="${USE_SUDO[*]} " && + tmp+=$@ && + $tmp +} + +function list_required { + "$CONFIG_DIR/$1/list.sh" | while read -r i + do + # Load data + i="`echo \"\$i\" | sed 's/ /\n/g'`" && + ARCH="`echo \"$i\" | sed -n '1p'`" && + VERSION="`echo \"$i\" | sed -n '2p'`" && + + # Install depends + "$CONFIG_DIR/$1/gen_script.sh" "$ARCH" "$VERSION" tmp.yaml && + j=$(run_command "$CONFIG_DIR/hash_modules.py" --depends tmp.yaml "$ARCH") + echo "$j" | while read -r k + do + (run_command flatpak install -y --user winebarrels "$k" > /dev/null 2> /dev/null) + done + + # Check version + j=$(run_command "$CONFIG_DIR/hash_modules.py" tmp.yaml "$ARCH") && + CURRENT_VERS="`echo \"\$j\" | sed -n '1p'`" && + WINE_VERS="`echo \"\$j\" | sed -n '2p'`" && + WINE_SDK_VERS="`echo \"\$j\" | sed -n '3p'`" + if [ "$CURRENT_VERS" != "$WINE_VERS" ] + then + $COMMAND "$1" "$ARCH" "$VERSION" + elif [ "$CURRENT_VERS" != "$WINE_SDK_VERS" ] + then + $COMMAND "$1" "$ARCH" "$VERSION" + fi + done +} + +list_required "Platform-v1.0"