Skip to content

Commit 73b275a

Browse files
committed
hiro: Remove gtksourceview dependency.
The GTK2 and GTK3 backends for hiro implement a source-code editing widget based on gtksourceview. gtksourceview2 in particular is quite old and unmaintained, and Linux distros are keen to drop it, so removing the dependency helps keep bsnes portable to future platforms -- especially since bsnes doesn't *use* the source-editing widget anywhere. It's only used by Near's text-editor, amethyst. We could just rip out the gtksourceview-related code and be done with it, but since Near is still around and still working on his own copy of hiro, I asked him to contribute his implementation so that it will be easier to merge any future changes too. This adds two new hiro targets, "gtk2-se" and "gtk3-se" which include the source-code editing widget and the gtksourceview dependency. Since bsnes defaults to "gtk2" (without the dependency) we no longer need that package installed to build bsnes. Fixes #137.
1 parent 2dc384a commit 73b275a

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

.cirrus.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ linux-x86_64-binaries_task:
33
image: ubuntu:latest
44

55
setup_script:
6-
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip
6+
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip
77

88
compile_script:
99
- make -C bsnes local=false
@@ -27,7 +27,7 @@ freebsd-x86_64-binaries_task:
2727
image_family: freebsd-12-2
2828

2929
setup_script:
30-
- pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtksourceview2 libXv zip
30+
- pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtk2 libXv zip
3131

3232
compile_script:
3333
- gmake -C bsnes local=false

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
sudo apt-get update -y -qq
2626
sudo apt-get install \
27-
libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev \
27+
libgtk2.0-dev libpulse-dev mesa-common-dev libcairo2-dev \
2828
libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev
2929
- name: Make
3030
run: make -j4 -C bsnes local=false

hiro/GNUmakefile

+20-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ ifeq ($(platform),windows)
99
endif
1010

1111
ifeq ($(hiro),gtk2)
12-
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0)
13-
hiro.options = $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0)
12+
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0) -Wno-deprecated-declarations
13+
hiro.options = $(shell pkg-config --libs gtk+-2.0)
1414
endif
1515

1616
ifeq ($(hiro),gtk3)
17-
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) -Wno-deprecated-declarations
18-
hiro.options = $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0)
17+
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0) -Wno-deprecated-declarations
18+
hiro.options = $(shell pkg-config --libs gtk+-3.0)
1919
endif
2020
endif
2121

@@ -26,7 +26,7 @@ ifeq ($(platform),macos)
2626

2727
ifeq ($(hiro),cocoa)
2828
hiro.flags = $(flags.objcpp) -w -DHIRO_COCOA
29-
hiro.options = -framework Cocoa -framework Carbon -framework Security
29+
hiro.options = -framework Cocoa -framework Carbon -framework IOKit -framework Security
3030
endif
3131
endif
3232

@@ -36,11 +36,23 @@ ifneq ($(filter $(platform),linux bsd),)
3636
endif
3737

3838
ifeq ($(hiro),gtk2)
39-
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0)
39+
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0) -Wno-deprecated-declarations
40+
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-2.0)
41+
endif
42+
43+
ifeq ($(hiro),gtk2-se)
44+
flags += -DHiro_SourceEdit
45+
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) -Wno-deprecated-declarations
4046
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0)
4147
endif
4248

4349
ifeq ($(hiro),gtk3)
50+
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0) -Wno-deprecated-declarations
51+
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-3.0)
52+
endif
53+
54+
ifeq ($(hiro),gtk3-se)
55+
flags += -DHiro_SourceEdit
4456
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) -Wno-deprecated-declarations
4557
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0)
4658
endif
@@ -69,11 +81,11 @@ hiro.objects := \
6981
$(object.path)/hiro-$(hiro).o: $(hiro.path)/hiro.cpp
7082
$(if $(filter qt%,$(hiro)),$(info Compiling $(hiro.path)/qt/qt.moc ...))
7183
$(if $(filter qt%,$(hiro)),@$(moc) -i -o $(hiro.path)/qt/qt.moc $(hiro.path)/qt/qt.hpp)
72-
$(info Compiling $< ...)
84+
$(info Compiling $(subst ../,,$<) ...)
7385
@$(compiler) $(hiro.flags) $(flags) $(flags.deps) -c $< -o $@
7486

7587
$(object.path)/hiro-resource.o: $(hiro.resource)
76-
$(info Compiling $< ...)
88+
$(info Compiling $(subst ../,,$<) ...)
7789
@$(windres) $< $@
7890

7991
hiro.verbose:

hiro/components.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#define Hiro_ProgressBar
6767
#define Hiro_RadioButton
6868
#define Hiro_RadioLabel
69-
#define Hiro_SourceEdit
69+
//#define Hiro_SourceEdit //added via GNUmakefile
7070
#define Hiro_TabFrame
7171
#define Hiro_TableView
7272
#define Hiro_TextEdit

0 commit comments

Comments
 (0)