From ca798989dae6ee6e1979642e56c115a3f857ccfb Mon Sep 17 00:00:00 2001 From: Simon van der Veldt Date: Tue, 4 Jun 2019 23:32:25 +0200 Subject: [PATCH] Install norns in system location So we can decouple it from the user's directory allowing for separate partitions in the future --- .../etc/profile.d/10-default-env-vars.sh | 1 + .../system.conf.d/10-default-env-vars.conf | 2 +- package/dust/dust.hash | 2 +- package/dust/dust.mk | 12 +-- package/dust/sclang_conf.yaml | 5 ++ package/norns/norns.mk | 24 ----- ...iles-to-system-wide-sc-extension-dir.patch | 34 +++++++ ...install-resources-in-system-location.patch | 89 +++++++++++++++++++ 8 files changed, 137 insertions(+), 32 deletions(-) create mode 100644 package/dust/sclang_conf.yaml create mode 100644 package/norns/sc-wscript-install-sc-files-to-system-wide-sc-extension-dir.patch create mode 100644 package/norns/wscript-install-resources-in-system-location.patch diff --git a/board/norns/rootfs-overlay/etc/profile.d/10-default-env-vars.sh b/board/norns/rootfs-overlay/etc/profile.d/10-default-env-vars.sh index d784562..39ac196 100644 --- a/board/norns/rootfs-overlay/etc/profile.d/10-default-env-vars.sh +++ b/board/norns/rootfs-overlay/etc/profile.d/10-default-env-vars.sh @@ -1,2 +1,3 @@ export JACK_NO_START_SERVER=1 export JACK_NO_AUDIO_RESERVATION=1 +export NORNS_CONFIG="/usr/share/norns/lua/core/config.lua" diff --git a/board/norns/rootfs-overlay/etc/systemd/system.conf.d/10-default-env-vars.conf b/board/norns/rootfs-overlay/etc/systemd/system.conf.d/10-default-env-vars.conf index 7259d12..d8f685a 100644 --- a/board/norns/rootfs-overlay/etc/systemd/system.conf.d/10-default-env-vars.conf +++ b/board/norns/rootfs-overlay/etc/systemd/system.conf.d/10-default-env-vars.conf @@ -1,2 +1,2 @@ [Manager] -DefaultEnvironment="JACK_NO_START_SERVER=1" +DefaultEnvironment=JACK_NO_START_SERVER=1 NORNS_CONFIG=/usr/share/norns/lua/core/config.lua diff --git a/package/dust/dust.hash b/package/dust/dust.hash index ec782e8..fadd96d 100644 --- a/package/dust/dust.hash +++ b/package/dust/dust.hash @@ -1,2 +1,2 @@ # Locally computed: -sha512 e73697bbf3f66302c3f33e72162de41e76aef24f41500f30949ff85621350cdc47868b414e7f359645cdb9244caa1dec129ba8c4798c6f7026f359b8b5ae150d dust-c10c62c24e88d1dc10c5eb3ed77f5b9b451fbe6c.tar.gz +sha512 f23fc37b8c6a40be226d5a587851dc8217db4484b082fe352e5c794d4a30357ef4ec64b37147811d4fd19c96f7d5f0e38accbabe505e775722029f57c5af60a0 norns-2.0.1-dust.tgz diff --git a/package/dust/dust.mk b/package/dust/dust.mk index 5c9ab39..9648416 100644 --- a/package/dust/dust.mk +++ b/package/dust/dust.mk @@ -4,17 +4,17 @@ # ################################################################################ -DUST_VERSION = c10c62c24e88d1dc10c5eb3ed77f5b9b451fbe6c -DUST_SITE = $(call github,monome,dust,$(DUST_VERSION)) +DUST_VERSION = 2.0.1 +DUST_SOURCE = norns-$(DUST_VERSION)-dust.tgz +DUST_SITE = https://monome.nyc3.digitaloceanspaces.com DUST_LICENSE = GPL-3.0 -DUST_LICENSE_FILES = LICENSE DUST_DEPENDENCIES = norns define DUST_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/root/dust - cp -a $(@D)/audio $(TARGET_DIR)/root/dust/audio - mkdir -p $(TARGET_DIR)/root/dust/data - mkdir -p $(TARGET_DIR)/root/dust/code + cp -a $(@D)/* $(TARGET_DIR)/root/dust + mkdir -p $(TARGET_DIR)/root/.config/SuperCollider + cp -a $(DUST_PKGDIR)/sclang_conf.yaml $(TARGET_DIR)/root/.config/SuperCollider/sclang_conf.yaml endef $(eval $(generic-package)) diff --git a/package/dust/sclang_conf.yaml b/package/dust/sclang_conf.yaml new file mode 100644 index 0000000..e3ad61f --- /dev/null +++ b/package/dust/sclang_conf.yaml @@ -0,0 +1,5 @@ +includePaths: + - ~/dust +excludePaths: + [] +postInlineWarnings: false diff --git a/package/norns/norns.mk b/package/norns/norns.mk index 96b193a..9c93c8f 100644 --- a/package/norns/norns.mk +++ b/package/norns/norns.mk @@ -12,28 +12,4 @@ NORNS_INSTALL_STAGING = YES NORNS_CONF_OPTS = --boost-includes=$(STAGING_DIR)/usr/include --boost-libs $(STAGING_DIR)/usr/lib NORNS_DEPENDENCIES = avahi boost cairo libevdev liblo libmonome lua nanomsg supercollider -# TODO temp fix to copy required files to hardcoded locations -# These should be installed to system directories and defined in the wscript - -define NORNS_POST_INSTALL_TARGET_USER - mkdir -p $(TARGET_DIR)/root/norns - cp -a $(@D)/resources ${TARGET_DIR}/root/norns/resources - cp -a $(@D)/lua ${TARGET_DIR}/root/norns/lua - mkdir -p $(TARGET_DIR)/root/norns/sc - cp -a $(@D)/sc/core ${TARGET_DIR}/root/norns/sc/ - cp -a $(@D)/sc/engines ${TARGET_DIR}/root/norns/sc/ - mkdir -p $(TARGET_DIR)/root/norns/sc/ugens - mkdir -p ${TARGET_DIR}/root/.local/share/SuperCollider/Extensions/ - cp -a $(@D)/sc/norns-config.sc ${TARGET_DIR}/root/.local/share/SuperCollider/Extensions/ -endef -NORNS_POST_INSTALL_TARGET_HOOKS += NORNS_POST_INSTALL_TARGET_USER - -# define NORNS_POST_INSTALL_TARGET_EXTENSIONS -# mkdir -p $(TARGET_DIR)/usr/share/SuperCollider/Extensions -# for file in $$(find $(@D)/sc -name "*.sc"); do \ -# cp $${file} $(TARGET_DIR)/usr/share/SuperCollider/Extensions/; \ -# done -# endef -# NORNS_POST_INSTALL_TARGET_HOOKS += NORNS_POST_INSTALL_TARGET_EXTENSIONS - $(eval $(waf-package)) diff --git a/package/norns/sc-wscript-install-sc-files-to-system-wide-sc-extension-dir.patch b/package/norns/sc-wscript-install-sc-files-to-system-wide-sc-extension-dir.patch new file mode 100644 index 0000000..a320e88 --- /dev/null +++ b/package/norns/sc-wscript-install-sc-files-to-system-wide-sc-extension-dir.patch @@ -0,0 +1,34 @@ +From 7a7e116b84b2a6aaeeb28098f6f90f89e54f187a Mon Sep 17 00:00:00 2001 +From: Simon van der Veldt +Date: Sun, 19 May 2019 22:21:52 +0200 +Subject: [PATCH] sc/wscript: Install SC files to system-wide Supercollider + extension directory + +--- + sc/wscript | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/sc/wscript b/sc/wscript +index fe18b0e..9534ba5 100644 +--- a/sc/wscript ++++ b/sc/wscript +@@ -1,4 +1,8 @@ +-top = '..' ++def set_options(opt): ++ pass ++ ++def configure(conf): ++ pass + + def build_ugen(bld, target, source): + ugen = bld.shlib(features='c cxx', +@@ -34,3 +38,7 @@ def build(bld): + for u in ugens: + build_ugen(bld, u['target'], u['source']) + build_ugen_supernova(bld, u['target'], u['source']) ++ ++ # Install SC files ++ bld.install_files('${PREFIX}/share/SuperCollider/Extensions/norns', bld.path.ant_glob('core/**/*'), relative_trick=True) ++ bld.install_files('${PREFIX}/share/SuperCollider/Extensions/norns', bld.path.ant_glob('engines/**/*'), relative_trick=True) +-- +2.21.0 diff --git a/package/norns/wscript-install-resources-in-system-location.patch b/package/norns/wscript-install-resources-in-system-location.patch new file mode 100644 index 0000000..777bcdd --- /dev/null +++ b/package/norns/wscript-install-resources-in-system-location.patch @@ -0,0 +1,89 @@ +From da328593c1aa599429f6de29f9b7f01143dbde5d Mon Sep 17 00:00:00 2001 +From: Simon van der Veldt +Date: Fri, 31 May 2019 23:24:19 +0200 +Subject: [PATCH] wscript: Install resources in system location + +--- + lua/core/config.lua | 5 +++-- + matron/src/hardware/screen.c | 9 ++++----- + wscript | 6 +++++- + 3 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/lua/core/config.lua b/lua/core/config.lua +index fc6b9d3..86458ae 100644 +--- a/lua/core/config.lua ++++ b/lua/core/config.lua +@@ -3,13 +3,14 @@ + -- add some stuff to package.path + -- this consists of search patterns lua will use for require('foo') + +-local home = os.getenv('HOME') +-local norns = home..'/norns/lua' ++local norns = '/usr/share/norns/lua' + local sys = norns..'/?.lua;' + local core = norns..'/core/?.lua;' + local params = norns..'/core/params/?.lua;' + local lib = norns..'/lib/?.lua;' + local softcut = norns..'/softcut/?.lua;' ++ ++local home = os.getenv('HOME') + local dust = home..'/dust/code/?.lua;' + + package.path = sys..core..params..lib..softcut..dust..package.path +diff --git a/matron/src/hardware/screen.c b/matron/src/hardware/screen.c +index 7bf3ac4..b9d796a 100644 +--- a/matron/src/hardware/screen.c ++++ b/matron/src/hardware/screen.c +@@ -139,10 +139,10 @@ handle_allocate_error: + void screen_display_png(const char *filename, double x, double y){ + int img_w, img_h; + //fprintf(stderr, "loading: %s\n", filename); +- ++ + image = cairo_image_surface_create_from_png (filename); + if(image == NULL) { return; } +- ++ + img_w = cairo_image_surface_get_width (image); + img_h = cairo_image_surface_get_height (image); + +@@ -246,13 +246,12 @@ void screen_init(void) { + for (int i=0; i