aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-05-15 22:04:13 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-05-15 22:04:13 +0200
commit58285f997aa05e3cbc069ec6b81c6876e0979e70 (patch)
treefa91c74e09299c7d26dda687654dc7929b90b4b6
parenta92741c189b7b29c1e7f4e7a7f728caf547682e1 (diff)
downloadmonitors.lv2-58285f997aa05e3cbc069ec6b81c6876e0979e70.zip
monitors.lv2-58285f997aa05e3cbc069ec6b81c6876e0979e70.tar.gz
monitors.lv2-58285f997aa05e3cbc069ec6b81c6876e0979e70.tar.bz2
monitors.lv2-58285f997aa05e3cbc069ec6b81c6876e0979e70.tar.xz
Squashed 'props.lv2/' changes from a92741c..85a84d3
85a84d3 initial migration to meson. git-subtree-dir: props.lv2 git-subtree-split: 85a84d32905c309adc8b3f01c152c6f30c64fe52
-rw-r--r--.gitlab-ci.yml73
-rw-r--r--CMakeLists.txt41
-rw-r--r--VERSION1
-rw-r--r--meson.build59
-rw-r--r--meson/arm-linux-gnueabihf18
-rw-r--r--meson/i686-linux-gnu17
-rw-r--r--meson/i686-w64-mingw3217
-rw-r--r--meson/universal-apple-darwin19
-rw-r--r--meson/x86_64-linux-gnu16
-rw-r--r--meson/x86_64-w64-mingw3217
-rw-r--r--test/manifest.ttl.in6
11 files changed, 240 insertions, 44 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..b11a1bb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,73 @@
+stages:
+ - build
+ - test
+ - deploy
+
+.variables_template: &variables_definition
+ variables:
+ BASE_NAME: "props.lv2"
+ PKG_CONFIG_PATH: "/opt/lv2/lib/pkgconfig:/opt/${CI_BUILD_NAME}/lib/pkgconfig"
+ TOOLCHAIN_FILE: "${CI_PROJECT_DIR}/cmake/${CI_BUILD_NAME}.cmake"
+
+.common_template: &common_definition
+ <<: *variables_definition
+ stage: build
+ artifacts:
+ name: "${BASE_NAME}-$(cat VERSION)-${CI_BUILD_NAME}"
+ paths:
+ - "${BASE_NAME}-$(cat VERSION)/"
+
+.build_template: &build_definition
+ <<: *common_definition
+ script:
+ - mkdir build
+ - pushd build
+ - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} -DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} ..
+ - cmake .. # needed for darwin
+ - make
+ - make install
+
+.universal_linux_template: &universal_linux_definition
+ image: ventosus/universal-linux-gnu
+ <<: *build_definition
+
+.arm_linux_template: &arm_linux_definition
+ image: ventosus/arm-linux-gnueabihf
+ <<: *build_definition
+
+.universal_w64_template: &universal_w64_definition
+ image: ventosus/universal-w64-mingw32
+ <<: *build_definition
+
+.universal_apple_template: &universal_apple_definition
+ image: ventosus/universal-apple-darwin
+ <<: *build_definition
+
+# building in docker
+x86_64-linux-gnu:
+ <<: *universal_linux_definition
+
+i686-linux-gnu:
+ <<: *universal_linux_definition
+
+arm-linux-gnueabihf:
+ <<: *arm_linux_definition
+
+x86_64-w64-mingw32:
+ <<: *universal_w64_definition
+
+i686-w64-mingw32:
+ <<: *universal_w64_definition
+
+universal-apple-darwin:
+ <<: *universal_apple_definition
+
+pack:
+ <<: *variables_definition
+ stage: deploy
+ script:
+ - echo 'packing up...'
+ artifacts:
+ name: "${BASE_NAME}-$(cat VERSION)"
+ paths:
+ - "${BASE_NAME}-$(cat VERSION)/"
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 2fff6f0..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(props.lv2)
-
-include_directories(${PROJECT_SOURCE_DIR})
-include_directories(${PROJECT_BINARY_DIR})
-
-set(CMAKE_C_FLAGS "-std=gnu99 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
-set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
-set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
-add_definitions("-D_GNU_SOURCE=1") # asprintf
-
-set(PROPS_MAJOR_VERSION 0)
-set(PROPS_MINOR_VERSION 1)
-set(PROPS_MICRO_VERSION 1)
-set(PROPS_VERSION "${PROPS_MAJOR_VERSION}.${PROPS_MINOR_VERSION}.${PROPS_MICRO_VERSION}")
-add_definitions("-DPROPS_VERSION=\"${PROPS_VERSION}\"")
-
-set(DEST lib/lv2/props.lv2)
-if(WIN32)
- set(LIB_EXT ".dll")
-elseif(APPLE)
- set(LIB_EXT ".so")
-else()
- set(LIB_EXT ".so")
-endif()
-
-find_package(PkgConfig) # ${PKG_CONFIG_FOUND}
-
-# props
-add_library(props MODULE
- test/props.c)
-target_link_libraries(props ${LIBS})
-set_target_properties(props PROPERTIES PREFIX "")
-install(TARGETS props DESTINATION ${DEST})
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/test/props.ttl DESTINATION ${DEST})
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/test/chunk.bin DESTINATION ${DEST})
-
-# manifest
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
-install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${DEST})
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..17e51c3
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1.1
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..cbaef78
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,59 @@
+project('props.lv2', 'c', default_options : [
+ 'buildtype=release',
+ 'warning_level=1',
+ 'werror=false',
+ 'b_lto=true',
+ 'c_std=c11'])
+
+add_project_arguments('-D_GNU_SOURCE', language : 'c')
+
+conf_data = configuration_data()
+cc = meson.get_compiler('c')
+
+cp = find_program('cp')
+clone = [cp, '@INPUT@', '@OUTPUT@']
+
+m_dep = cc.find_library('m')
+lv2_dep = dependency('lv2', version : '>=1.14.0')
+
+inc_dir = []
+
+inst_dir = join_paths(get_option('libdir'), 'lv2', meson.project_name())
+
+dsp_srcs = [join_paths('test', 'props.c')]
+
+c_args = ['-fvisibility=hidden',
+ '-ffast-math']
+
+mod = shared_module('props', dsp_srcs,
+ c_args : c_args,
+ include_directories : inc_dir,
+ name_prefix : '',
+ dependencies : [m_dep, lv2_dep],
+ install : true,
+ install_dir : inst_dir)
+
+version = run_command('cat', 'VERSION').stdout().strip().split('.')
+conf_data.set('MAJOR_VERSION', version[0])
+conf_data.set('MINOR_VERSION', version[1])
+conf_data.set('MICRO_VERSION', version[2])
+
+suffix = mod.full_path().strip().split('.')[-1]
+conf_data.set('MODULE_SUFFIX', '.' + suffix)
+
+configure_file(input : join_paths('test', 'manifest.ttl.in'), output : 'manifest.ttl',
+ configuration : conf_data,
+ install : true,
+ install_dir : inst_dir)
+custom_target('props_ttl',
+ input : join_paths('test', 'props.ttl'),
+ output : 'props.ttl',
+ command : clone,
+ install : true,
+ install_dir : inst_dir)
+custom_target('chunk_bin',
+ input : join_paths('test', 'chunk.bin'),
+ output : 'chunk.bin',
+ command : clone,
+ install : true,
+ install_dir : inst_dir)
diff --git a/meson/arm-linux-gnueabihf b/meson/arm-linux-gnueabihf
new file mode 100644
index 0000000..241266e
--- /dev/null
+++ b/meson/arm-linux-gnueabihf
@@ -0,0 +1,18 @@
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7hl'
+endian = 'little'
+
+[binaries]
+c = '/usr/bin/arm-linux-gnueabihf-gcc'
+cpp = '/usr/bin/arm-linux-gnueabihf-g++'
+ar = '/usr/bin/arm-linux-gnueabihf-ar'
+strip = '/usr/bin/arm-linux-gnueabihf-strip'
+pkgconfig = '/usr/bin/pkg-config'
+exe_wrapper = '/usr/bin/qemu-arm'
+
+[properties]
+root = '/usr/arm-linux-gnueabihf'
+c_link_args = ['-Wl,-z,defs']
+needs_exe_wrapper = true
diff --git a/meson/i686-linux-gnu b/meson/i686-linux-gnu
new file mode 100644
index 0000000..ff653c6
--- /dev/null
+++ b/meson/i686-linux-gnu
@@ -0,0 +1,17 @@
+[host_machine]
+system = 'linux'
+cpu_family = 'x86'
+cpu = 'i686'
+endian = 'little'
+
+[binaries]
+c = '/usr/bin/x86_64-linux-gnu-gcc'
+cpp = '/usr/bin/x86_64-linux-gnu-g++'
+ar = '/usr/bin/x86_64-linux-gnu-ar'
+strip = '/usr/bin/x86_64-linux-gnu-strip'
+pkgconfig = '/usr/bin/pkg-config'
+
+[properties]
+c_args = ['-m32']
+c_link_args = ['-m32', '-Wl,-z,defs']
+needs_exe_wrapper = false
diff --git a/meson/i686-w64-mingw32 b/meson/i686-w64-mingw32
new file mode 100644
index 0000000..4966ba7
--- /dev/null
+++ b/meson/i686-w64-mingw32
@@ -0,0 +1,17 @@
+[host_machine]
+system = 'windows'
+cpu_family = 'i686'
+cpu = 'i686'
+endian = 'little'
+
+[binaries]
+c = '/usr/bin/i686-w64-mingw32-gcc'
+cpp = '/usr/bin/i686-w64-mingw32-g++'
+ar = '/usr/bin/i686-w64-mingw32-ar'
+strip = '/usr/bin/i686-w64-mingw32-strip'
+pkgconfig = '/usr/bin/pkg-config'
+exe_wrapper = '/usr/bin/wine'
+
+[properties]
+root = '/usr/i686-w64-mingw32'
+needs_exe_wrapper = true
diff --git a/meson/universal-apple-darwin b/meson/universal-apple-darwin
new file mode 100644
index 0000000..0ee2e02
--- /dev/null
+++ b/meson/universal-apple-darwin
@@ -0,0 +1,19 @@
+[host_machine]
+system = 'darwin'
+cpu_family = 'x86_64'
+cpu = 'x86_64'
+endian = 'little'
+
+[binaries]
+c = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang'
+cpp = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang++'
+objc = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang'
+ar = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-ar'
+strip = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-strip'
+pkgconfig = '/usr/bin/pkg-config'
+
+[properties]
+root = '/usr/universal-apple-darwin/SDK/MacOSX10.11.sdk'
+c_args = ['-arch', 'i386', '-arch', 'x86_64']
+c_link_args = ['-arch', 'i386', '-arch', 'x86_64']
+needs_exe_wrapper = true
diff --git a/meson/x86_64-linux-gnu b/meson/x86_64-linux-gnu
new file mode 100644
index 0000000..b09321c
--- /dev/null
+++ b/meson/x86_64-linux-gnu
@@ -0,0 +1,16 @@
+[host_machine]
+system = 'linux'
+cpu_family = 'x86_64'
+cpu = 'x86_64'
+endian = 'little'
+
+[binaries]
+c = '/usr/bin/x86_64-linux-gnu-gcc'
+cpp = '/usr/bin/x86_64-linux-gnu-g++'
+ar = '/usr/bin/x86_64-linux-gnu-ar'
+strip = '/usr/bin/x86_64-linux-gnu-strip'
+pkgconfig = '/usr/bin/pkg-config'
+
+[properties]
+c_link_args = ['-Wl,-z,defs']
+needs_exe_wrapper = false
diff --git a/meson/x86_64-w64-mingw32 b/meson/x86_64-w64-mingw32
new file mode 100644
index 0000000..40c8a32
--- /dev/null
+++ b/meson/x86_64-w64-mingw32
@@ -0,0 +1,17 @@
+[host_machine]
+system = 'windows'
+cpu_family = 'x86_64'
+cpu = 'x86_64'
+endian = 'little'
+
+[binaries]
+c = '/usr/bin/x86_64-w64-mingw32-gcc'
+cpp = '/usr/bin/x86_64-w64-mingw32-g++'
+ar = '/usr/bin/x86_64-w64-mingw32-ar'
+strip = '/usr/bin/x86_64-w64-mingw32-strip'
+pkgconfig = '/usr/bin/pkg-config'
+exe_wrapper = '/usr/bin/wine64'
+
+[properties]
+root = '/usr/x86_64-w64-mingw32'
+needs_exe_wrapper = true
diff --git a/test/manifest.ttl.in b/test/manifest.ttl.in
index c477aeb..0ecc313 100644
--- a/test/manifest.ttl.in
+++ b/test/manifest.ttl.in
@@ -22,7 +22,7 @@
# Orbit Looper
props:test
a lv2:Plugin ;
- lv2:minorVersion @PROPS_MINOR_VERSION@ ;
- lv2:microVersion @PROPS_MICRO_VERSION@ ;
- lv2:binary <props@LIB_EXT@> ;
+ lv2:minorVersion @MINOR_VERSION@ ;
+ lv2:microVersion @MICRO_VERSION@ ;
+ lv2:binary <props@MODULE_SUFFIX@> ;
rdfs:seeAlso <props.ttl> .