From 3a44fdb66b32e220b01435f3505f71ef4bbfb17b Mon Sep 17 00:00:00 2001 From: beefcurtains Date: Wed, 27 May 2015 02:46:14 +0000 Subject: [PATCH 1/2] New package: dumb-1.0 --- srcpkgs/dumb-devel | 1 + srcpkgs/dumb/patches/fix-build.patch | 19 +++++++++++++++ srcpkgs/dumb/template | 35 ++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 120000 srcpkgs/dumb-devel create mode 100644 srcpkgs/dumb/patches/fix-build.patch create mode 100644 srcpkgs/dumb/template diff --git a/srcpkgs/dumb-devel b/srcpkgs/dumb-devel new file mode 120000 index 00000000000..6509fa65327 --- /dev/null +++ b/srcpkgs/dumb-devel @@ -0,0 +1 @@ +dumb \ No newline at end of file diff --git a/srcpkgs/dumb/patches/fix-build.patch b/srcpkgs/dumb/patches/fix-build.patch new file mode 100644 index 00000000000..deb48a7d574 --- /dev/null +++ b/srcpkgs/dumb/patches/fix-build.patch @@ -0,0 +1,19 @@ +--- dumb/cmake/CMakeLists.txt.orig ++++ dumb/cmake/CMakeLists.txt +@@ -1,7 +1,7 @@ + cmake_minimum_required(VERSION 2.6) + project(libdumb C) + +-set(CMAKE_C_FLAGS "-Wall -DDUMB_DECLARE_DEPRECATED -D_USE_SSE -msse -Wno-unused-variable -Wno-unused-but-set-variable") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -DDUMB_DECLARE_DEPRECATED -Wno-unused-variable -Wno-unused-but-set-variable") + set(CMAKE_C_FLAGS_DEBUG "-ggdb -DDEBUGMODE=1 -D_DEBUG") + set(CMAKE_C_FLAGS_RELEASE "-ffast-math -O2 -DNDEBUG") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ffast-math -g -O2 -DNDEBUG") +@@ -103,6 +103,7 @@ + ) + + add_library(dumb ${SOURCES}) ++set_target_properties(dumb PROPERTIES VERSION 1.0) + set_target_properties(dumb PROPERTIES DEBUG_POSTFIX d) + + # Make sure the dylib install name path is set on OSX so you can include dumb in app bundles diff --git a/srcpkgs/dumb/template b/srcpkgs/dumb/template new file mode 100644 index 00000000000..b0cda404c12 --- /dev/null +++ b/srcpkgs/dumb/template @@ -0,0 +1,35 @@ +# Template file for 'dumb' +pkgname=dumb +version=1.0 +revision=1 +build_wrksrc=${pkgname}/cmake +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS:BOOL=ON" +hostmakedepends="cmake" +short_desc="IT, XM, S3M and MOD player library" +maintainer="beefcurtains " +license="BSD" +homepage="http://${pkgname}.sourceforge.net/" +distfiles="https://github.com/kode54/${pkgname}/archive/${version}.tar.gz" +checksum=09ea62fd01f6e71cb28a8a8c1c1e356e7eb38f5e003b684e12eb1944c6d35fa5 + +case "$XBPS_TARGET_MACHINE" in + i686*|x86_64*) + CFLAGS="-D_USE_SSE -msse" + ;; +esac + +pre_install() { + vdoc ../readme.txt + vdoc ../release.txt + vlicense ../licence.txt +} + +dumb-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove "usr/lib/*.so" + vmove usr/include + } +} From e477feeff8b7edd773f93df8e794a4d90d6d1994 Mon Sep 17 00:00:00 2001 From: beefcurtains Date: Thu, 28 May 2015 07:22:15 +0000 Subject: [PATCH 2/2] dumb: Add example frontend --- .../dumb/patches/example-use-1.0-api.patch | 11 +++++++ srcpkgs/dumb/patches/fix-build.patch | 4 +-- srcpkgs/dumb/template | 33 +++++++++++++++++-- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/dumb/patches/example-use-1.0-api.patch diff --git a/srcpkgs/dumb/patches/example-use-1.0-api.patch b/srcpkgs/dumb/patches/example-use-1.0-api.patch new file mode 100644 index 00000000000..ef94b4aa6d1 --- /dev/null +++ b/srcpkgs/dumb/patches/example-use-1.0-api.patch @@ -0,0 +1,11 @@ +--- %_example_wrksrc%/dumb2wav.c.orig ++++ %_example_wrksrc%/dumb2wav.c +@@ -221,7 +221,7 @@ + if (!duh) { + duh = dumb_load_s3m(fn); + if (!duh) { +- duh = dumb_load_mod(fn); ++ duh = dumb_load_mod(fn, 0); + if (!duh) { + fprintf(stderr, "Unable to open %s!\n", fn); + return EXIT_FAILURE; diff --git a/srcpkgs/dumb/patches/fix-build.patch b/srcpkgs/dumb/patches/fix-build.patch index deb48a7d574..bcb4d3eb741 100644 --- a/srcpkgs/dumb/patches/fix-build.patch +++ b/srcpkgs/dumb/patches/fix-build.patch @@ -1,5 +1,5 @@ ---- dumb/cmake/CMakeLists.txt.orig -+++ dumb/cmake/CMakeLists.txt +--- %_library_wrksrc%/cmake/CMakeLists.txt.orig ++++ %_library_wrksrc%/cmake/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(libdumb C) diff --git a/srcpkgs/dumb/template b/srcpkgs/dumb/template index b0cda404c12..da6c5cbfff1 100644 --- a/srcpkgs/dumb/template +++ b/srcpkgs/dumb/template @@ -2,7 +2,13 @@ pkgname=dumb version=1.0 revision=1 -build_wrksrc=${pkgname}/cmake +create_wrksrc=yes +wrksrc=sources + +_library_wrksrc=${pkgname}-${version}/${pkgname} +_example_wrksrc=${pkgname}-0.9.3/examples +build_wrksrc=${_library_wrksrc}/cmake + build_style=cmake configure_args="-DBUILD_SHARED_LIBS:BOOL=ON" hostmakedepends="cmake" @@ -10,8 +16,14 @@ short_desc="IT, XM, S3M and MOD player library" maintainer="beefcurtains " license="BSD" homepage="http://${pkgname}.sourceforge.net/" -distfiles="https://github.com/kode54/${pkgname}/archive/${version}.tar.gz" -checksum=09ea62fd01f6e71cb28a8a8c1c1e356e7eb38f5e003b684e12eb1944c6d35fa5 +distfiles=" + https://github.com/kode54/${pkgname}/archive/${version}.tar.gz + ${SOURCEFORGE_SITE}/${pkgname}/${pkgname}/0.9.3/${pkgname}-0.9.3.tar.gz +" +checksum=" + 09ea62fd01f6e71cb28a8a8c1c1e356e7eb38f5e003b684e12eb1944c6d35fa5 + 8d44fbc9e57f3bac9f761c3b12ce102d47d717f0dd846657fb988e0bb5d1ea33 +" case "$XBPS_TARGET_MACHINE" in i686*|x86_64*) @@ -19,7 +31,22 @@ case "$XBPS_TARGET_MACHINE" in ;; esac +pre_fetch() { + sed -i \ + -e "s,%_library_wrksrc%,$_library_wrksrc," \ + -e "s,%_example_wrksrc%,$_example_wrksrc," \ + $PATCHESDIR/* +} + +post_build() { + ( set -x + ${CC} ${wrksrc}/${_example_wrksrc}/dumb2wav.c \ + ${CFLAGS} ${CPPFLAGS} -I../../include \ + ${LDFLAGS} -L. -ldumb -lm -o dumb2wav ) +} + pre_install() { + vbin build/dumb2wav vdoc ../readme.txt vdoc ../release.txt vlicense ../licence.txt