summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVekhir2024-01-16 13:20:43 +0100
committerVekhir2024-01-16 13:20:43 +0100
commit31aa40d4bc3a67d21429b8285a2b1a5c2a63b57a (patch)
tree91dcc1dae7761ecfe48dd069261e99d987859bed
downloadaur-31aa40d4bc3a67d21429b8285a2b1a5c2a63b57a.tar.gz
Initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD48
-rw-r--r--hedgewars-cabal.patch130
3 files changed, 209 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..570b2be6d90f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = hedgewars-server-hg
+ pkgdesc = Turn-based strategy artillery game similiar to Worms (Server component)
+ pkgver = r15983+.2c92499daa67+
+ pkgrel = 1
+ url = https://hedgewars.org
+ arch = x86_64
+ license = GPL
+ license = custom
+ makedepends = mercurial
+ makedepends = ghc
+ makedepends = uusi
+ depends = ghc-libs
+ depends = haskell-entropy
+ depends = haskell-sha
+ depends = haskell-random
+ depends = haskell-regex-tdfa
+ depends = haskell-sandi
+ depends = haskell-hslogger
+ depends = haskell-network
+ depends = haskell-network-bsd
+ depends = haskell-utf8-string
+ depends = haskell-vector
+ provides = hedgewars-server
+ conflicts = hedgewars
+ conflicts = hedgewars-hg
+ source = hedgewars-server-hg::hg+https://hg.hedgewars.org/hedgewars
+ source = hedgewars-cabal.patch
+ sha512sums = SKIP
+ sha512sums = 09b6dad1f1fa03e2e24775542135407c0b861519e3fbef08e968abaf59011b54609db64514c841af9e3ee588b1c7e0bbf13c971fa46758aecafb399ac7e30e13
+
+pkgname = hedgewars-server-hg
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..895adfe1cb81
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Vekhir <vekhir AT yahoo DOT com>
+
+pkgname=hedgewars-server-hg
+pkgver=r15983+.2c92499daa67+
+pkgrel=1
+pkgdesc="Turn-based strategy artillery game similiar to Worms (Server component)"
+arch=('x86_64')
+url="https://hedgewars.org"
+license=('GPL' 'custom')
+depends=('ghc-libs' 'haskell-entropy' 'haskell-sha' 'haskell-random' 'haskell-regex-tdfa'
+ 'haskell-sandi' 'haskell-hslogger' 'haskell-network' 'haskell-network-bsd'
+ 'haskell-utf8-string' 'haskell-vector')
+makedepends=('mercurial' 'ghc' 'uusi')
+provides=('hedgewars-server')
+conflicts=('hedgewars' 'hedgewars-hg')
+source=("$pkgname::hg+https://hg.hedgewars.org/hedgewars"
+ "hedgewars-cabal.patch")
+sha512sums=('SKIP'
+ '09b6dad1f1fa03e2e24775542135407c0b861519e3fbef08e968abaf59011b54609db64514c841af9e3ee588b1c7e0bbf13c971fa46758aecafb399ac7e30e13')
+
+pkgver() {
+ cd "$pkgname"
+ printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
+}
+
+prepare() {
+ cd "$pkgname"
+ patch -p1 < ../hedgewars-cabal.patch
+ cd gameServer
+ gen-setup
+ uusi --nb checker
+}
+
+build() {
+ cd "$pkgname"/gameServer
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm
+ runhaskell Setup build $MAKEFLAGS
+}
+
+package() {
+ cd "$pkgname"/gameServer
+
+ runhaskell Setup copy --destdir="$pkgdir"
+ install -D -m644 ../COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/hedgewars-cabal.patch b/hedgewars-cabal.patch
new file mode 100644
index 000000000000..6be278a0df64
--- /dev/null
+++ b/hedgewars-cabal.patch
@@ -0,0 +1,130 @@
+diff -ru a/gameServer/hedgewars-server.cabal b/gameServer/hedgewars-server.cabal
+--- a/gameServer/hedgewars-server.cabal 2024-01-14 13:07:05.485982876 +0100
++++ b/gameServer/hedgewars-server.cabal 2024-01-14 13:50:53.439694635 +0100
+@@ -1,5 +1,5 @@
+ Name: hedgewars-server
+-Version: 0.1
++Version: 1.1.0
+ Synopsis: hedgewars server
+ Description: hedgewars server
+ Homepage: https://www.hedgewars.org/
+@@ -11,37 +11,71 @@
+ Cabal-version: >=1.10
+
+
++flag officialServer
++ description: Build for official server
++ default: False
++ manual: True
++
+ Executable hedgewars-server
+ main-is: hedgewars-server.hs
++ other-modules:
++ Actions
++ ClientIO
++ CommandHelp
++ ConfigFile
++ Consts
++ CoreTypes
++ Data.TConfig
++ EngineInteraction
++ FloodDetection
++ HWProtoChecker
++ HWProtoCore
++ HWProtoInRoomState
++ HWProtoLobbyState
++ HWProtoNEState
++ HandlerUtils
++ JoinsMonitor
++ NetRoutines
++ OfficialServer.DBInteraction
++ Opts
++ RoomsAndClients
++ ServerCore
++ ServerState
++ Store
++ Utils
++ Votes
+
+ default-language: Haskell2010
+
+ -- Don't forget to update INSTALL.md and .travis.yml when you change these dependencies!
+ Build-depends:
+ base >= 4.8,
+- containers,
+- vector,
++ binary >= 0.8.5.1,
+ bytestring,
+- network >= 2.3 && < 3.2,
++ containers,
++ deepseq,
++ entropy,
++ hslogger,
++ mtl >= 2,
++ network >= 3.0 && < 3.2,
+ network-bsd >= 2.8.1 && < 2.9,
++ process,
+ random,
+- time,
+- mtl >= 2,
++ regex-tdfa,
+ sandi,
+- hslogger,
+- process,
+- deepseq,
+- utf8-string,
+ SHA,
+- entropy,
+- zlib >= 0.5.3 && < 0.7,
+- regex-tdfa,
+- binary >= 0.8.5.1,
++ time,
++ utf8-string,
++ vector
+
+ -- These dependencies are for OFFICIAL_SERVER only and do not need to be mentioned in docs
+- yaml >= 0.8.30,
+- aeson,
+- text >= 1.2
++ if flag(officialServer)
++ build-depends:
++ aeson,
++ text >= 1.2,
++ yaml >= 0.8.30,
++ zlib >= 0.5.3 && < 0.7
++ cpp-options: -DOFFICIAL_SERVER
+
+ if !os(windows)
+ build-depends: unix
+diff -ru a/INSTALL.md b/INSTALL.md
+--- a/INSTALL.md 2024-01-14 13:29:29.979953712 +0100
++++ b/INSTALL.md 2024-01-14 14:03:57.308690933 +0100
+@@ -81,6 +81,11 @@
+ - `regex-tdfa`
+ - `binary` >= 0.8.5.1
+
++If you use the `Cabal` based build process:
++ - `zlib` is not needed.
++ - `network` >= 3.0
++ - `network-bsd` >= 2.8.1
++
+ Building
+ --------
+
+@@ -140,6 +145,16 @@
+
+ That's all! Enjoy!
+
++### Building the Hedgewars Server only
++
++The Hedgewars Server can also be built separately using `Cabal`. All necessary
++files, including the `hedgewars-server.cabal`, are in the `gameServer`
++subdirectory.
++For most users, the server isn't needed, and this possibility is targeted
++primarily at packagers. If you don't know how to build Haskell projects with
++`Cabal`, this option is likely not for you. Instead use the `cmake` based
++instructions above.
++
+ Troubleshooting
+ ---------------
+