+(define-public deutex
+ (package
+ (name "deutex")
+ (version "4.4.902")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/Doom-Utils/" name
+ "/archive/v" version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0rwz1yzgd539x4h25kzhar4q02xyxjwfrcpz4m8ixi312a82p7cn"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ; no check target
+ #:phases
+ (modify-phases %standard-phases
+ ;; The provided configure script takes a restricted number of arguments.
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (zero? (system* "./configure" "--prefix"
+ (assoc-ref %outputs "out")))))
+ ;; "make install" is broken for this package.
+ ;; Notably, the binaries overrwrite one another upon installation as
+ ;; they are all installed to the "bin" file in the output directory,
+ ;; and the manual page fails to install because the directory for the
+ ;; manual page is not created.
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin"))
+ (share (string-append out "/share")))
+ (install-file "deusf" bin)
+ (install-file "deutex" bin)
+ (install-file "deutex.6" (string-append share "/man/man6")))
+ #t)))))
+ (home-page "https://github.com/Doom-Utils/deutex")
+ (synopsis "WAD file composer for Doom and related games")
+ (description
+ "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
+used to extract the lumps of a wad and save them as individual files.
+Conversely, it can also build a wad from separate files. When extracting a
+lump to a file, it does not just copy the raw data, it converts it to an
+appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
+Conversely, when it reads files for inclusion in pwads, it does the necessary
+conversions (for example, from PPM to Doom picture format). In addition,
+DeuTex has functions such as merging wads, etc.")
+ (license license:gpl2+)))
+
+(define-public grfcodec
+ (package
+ (name "grfcodec")
+ (version "6.0.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://binaries.openttd.org/extra/"
+ name "/" version "/" name "-" version
+ "-source.tar.xz"))
+ (sha256
+ (base32
+ "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ; no check target
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (replace 'install ; no install target
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (doc (string-append out "/share/doc"))
+ (man (string-append out "/share/man/man1")))
+ (for-each (lambda (file)
+ (install-file file bin))
+ '("grfcodec" "grfid" "grfstrip" "nforenum"))
+ (install-file "COPYING" doc)
+ (with-directory-excursion "docs"
+ (for-each (lambda (file)
+ (install-file (string-append file ".txt") doc))
+ '("auto_correct" "commands" "grf" "grfcodec" "grftut"
+ "readme" "readme.rpn"))
+ (for-each (lambda (file)
+ (install-file file man))
+ (find-files "." "\\.1"))))
+ #t)))))
+ (inputs
+ `(("boost" ,boost)
+ ("libpng" ,libpng)
+ ("zlib" ,zlib)))
+ (synopsis "GRF development tools")
+ (description
+ "The @dfn{Graphics Resource File} (GRF) development tools are a set of
+tools for developing (New)GRFs. It includes a number of smaller programs, each
+with a specific task:
+@enumerate
+@item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
+@item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
+@item @code{grfstrip} strips all sprites from a GRF.
+@item @code{nforenum} checks NFO code for errors, making corrections when
+necessary.
+@end enumerate")
+ (home-page "http://dev.openttdcoop.org/projects/grfcodec")
+ ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
+ ;; NFORenum is under the GPL2+.
+ ;; The MD5 implementation contained in GRFID is under the zlib license.
+ (license (list license:gpl2 license:gpl2+ license:zlib))))
+