aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-02-12 14:51:46 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-02-12 15:04:02 +0000
commitdd896b93e33038119fabda0e73367e460a75996f (patch)
treeedbd5ae3b8ac7ac82411c6d2a09e9fc4a85a30fd /bootstrap
downloadcross-compile-hs-wine-dd896b93e33038119fabda0e73367e460a75996f.tar.gz
cross-compile-hs-wine-dd896b93e33038119fabda0e73367e460a75996f.zip
Initial import
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap72
1 files changed, 72 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..aba6584
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+set +e
+
+PACKAGES="""
+https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0/cabal-install-3.8.1.0-x86_64-windows.zip
+https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-x86_64-unknown-mingw32-integer-simple.tar.xz
+https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/x86_64-12.2.0-release-win32-seh-msvcrt-rt_v10-rev2.7z
+https://github.com/libsdl-org/SDL/releases/download/release-2.26.3/SDL2-devel-2.26.3-mingw.tar.gz
+https://github.com/libsdl-org/SDL_image/releases/download/release-2.6.3/SDL2_image-devel-2.6.3-mingw.tar.gz
+https://downloads.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
+"""
+
+mkdir -p packages cache workdir
+
+for p in $PACKAGES; do
+ fname=`basename $p`
+ if [ -f cache/$fname ]; then
+ echo $fname already downloaded: OK
+ else
+ wget $p -O cache/$fname
+ fi
+done
+
+if [ -d packages/cabal ]; then
+ echo packages/cabal directory exists, skipping
+else
+ echo Extracting Cabal
+ unzip cache/cabal-install-3.8.1.0-x86_64-windows.zip -d packages/cabal
+fi
+
+if [ -d packages/ghc ]; then
+ echo packages/ghc directory exists, skipping
+else
+ echo Extracting GHC
+ tar -C packages -xJf cache/ghc-9.2.5-x86_64-unknown-mingw32-integer-simple.tar.xz
+ mv packages/ghc-9.2.5-x86_64-unknown-mingw32 packages/ghc
+fi
+
+if [ -f packages/cabal/pkg-config.exe ]; then
+ echo packages/cabal/pkg-config.exe exists, skipping
+else
+ echo Extracting pkg-config.exe
+ unzip -j cache/pkg-config-lite-0.28-1_bin-win32.zip pkg-config-lite-0.28-1/bin/pkg-config.exe -d packages/cabal
+fi
+
+if [ -d packages/mingw64 ]; then
+ echo packages/mingw84 directory exists, skipping
+else
+ echo Extracting MingGW-W64
+ 7z x -opackages cache/x86_64-12.2.0-release-win32-seh-msvcrt-rt_v10-rev2.7z
+fi
+
+if [ -d packages/sdl ]; then
+ echo packages/sdl directory exists, skipping
+else
+ echo Extractig SDL2
+ tar -C packages -xzf cache/SDL2-devel-2.26.3-mingw.tar.gz
+ mv packages/SDL2-2.26.3 packages/sdl
+ make CROSS_PATH=`realpath $PWD/packages/mingw64` -C packages/sdl cross
+fi
+
+if [ -d packages/sdl-image ]; then
+ echo packages/sdl-image directory exists, skipping
+else
+ echo Extracting SDL2_Image
+ tar -C packages -xzf cache/SDL2_image-devel-2.6.3-mingw.tar.gz
+ mv packages/SDL2_image-2.6.3 packages/sdl-image
+ make CROSS_PATH=`realpath $PWD/packages/mingw64` -C packages/sdl-image cross
+fi
+
+echo "DONE!"