2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchpatch, fetchurl, bison, perl }:
|
2018-02-24 17:41:07 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "0.0.6";
|
|
|
|
debianRevision = "7";
|
|
|
|
debianPatch = patchname: hash: fetchpatch {
|
|
|
|
name = "${patchname}.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/b/bulletml/${version}-${debianRevision}/debian/patches/${patchname}.patch";
|
|
|
|
sha256 = hash;
|
|
|
|
};
|
|
|
|
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
lib_src = fetchurl {
|
|
|
|
url = "http://shinh.skr.jp/libbulletml/libbulletml-${version}.tar.bz2";
|
|
|
|
sha256 = "0yda0zgj2ydgkmby5676f5iiawabxadzh5p7bmy42998sp9g6dvw";
|
|
|
|
};
|
|
|
|
|
|
|
|
cpp_src = fetchurl {
|
|
|
|
url = "http://shinh.skr.jp/d/d_cpp.tar.bz2";
|
|
|
|
sha256 = "1ly9qmbb8q9nyadmdap1gmxs3vkniqgchlv2hw7riansz4gg1agh";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "bulletml";
|
|
|
|
inherit version;
|
2018-02-24 17:41:07 +00:00
|
|
|
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
srcs = [ lib_src cpp_src ];
|
|
|
|
|
2018-02-24 17:41:07 +00:00
|
|
|
postUnpack = "mv d_cpp bulletml/";
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 17:18:01 +00:00
|
|
|
sourceRoot = "bulletml";
|
2018-02-24 17:41:07 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
(debianPatch "fixes" "0cnr968n0h50fjmjijx7idsa2pg2pv5cwy6nvfbkx9z8w2zf0mkl")
|
|
|
|
(debianPatch "bulletml_d" "03d1dgln3gkiw019pxn3gwgjkmvzisq8kp3n6fpn38yfwh4fp4hv")
|
|
|
|
(debianPatch "d_cpp" "04g9c7c89w7cgrxw75mcbdhzxqmz1716li49mhl98znakchrlb9h")
|
|
|
|
(debianPatch "warnings" "18px79x4drvm6dy6w6js53nzlyvha7qaxhz5a99b97pyk3qc7i9g")
|
|
|
|
(debianPatch "makefile" "0z6yxanxmarx0s08gh12pk2wfqjk8g797wmfcqczdv1i6xc7nqzp")
|
|
|
|
(debianPatch "includes" "1n11j5695hs9pspslf748w2cq5d78s6bwhyl476wp6gcq6jw20bw")
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"-C src"
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [ bison perl ];
|
2018-06-02 08:45:02 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2018-02-24 17:41:07 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D -m 644 src/bulletml.d "$out"/include/d/bulletml.d
|
|
|
|
install -d "$out"/include/bulletml/tinyxml
|
|
|
|
install -m 644 src/*.h "$out"/include/bulletml
|
|
|
|
install -m 644 src/tinyxml/tinyxml.h "$out"/include/bulletml/tinyxml
|
|
|
|
cp -r src/boost $out/include/boost
|
|
|
|
|
|
|
|
install -d "$out"/lib
|
|
|
|
install -m 644 src/libbulletml.{a,so}* "$out"/lib
|
|
|
|
|
|
|
|
install -D -m 644 README "$out"/share/doc/libbulletml/README.jp
|
|
|
|
install -m 644 README.en "$out"/share/doc/libbulletml
|
|
|
|
install -m 644 README.bulletml "$out"/share/doc/libbulletml
|
|
|
|
install -D -m 644 README "$out"/share/licenses/libbulletml/README.jp
|
|
|
|
install -m 644 README.en "$out"/share/licenses/libbulletml
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-02-24 17:41:07 +00:00
|
|
|
description = "C++ library to handle BulletML easily";
|
|
|
|
longDescription = ''
|
|
|
|
BulletML is the Bullet Markup Language. BulletML can describe the barrage
|
|
|
|
of bullets in shooting games.
|
|
|
|
'';
|
|
|
|
homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/35482
|
|
|
|
# for some attempts in getting it to build on darwin
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|