diff --git a/Makefile b/Makefile index bf7abb7..38e2ace 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,13 @@ ibus-xml: $(shell SCHEMES=("ml" "ta" "hi" "te" "ka" "bn"); for s in $${SCHEMES[@]}; do echo $s; ./${BIN} -s $$s -lang $$s -xml component/varnam-$$s.xml -prefix ${INSTALL_PREFIX}; done) +ubuntu-14: + CGO_CFLAGS="-w" go build -tags "pango_1_36,gtk_3_10,glib_2_40,cairo_1_13,gdk_pixbuf_2_30" -ldflags "-s -w" -o ${BIN} . + $(MAKE) ibus-xml + $(MAKE) install-script + ubuntu-18: - go build -tags pango_1_42,gtk_3_22 -ldflags "-s -w" -o ${BIN} . + go build -tags "pango_1_42,gtk_3_22,glib_2_66,cairo_1_15" -ldflags "-s -w" -o ${BIN} . $(MAKE) ibus-xml $(MAKE) install-script diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b9a042b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:trusty + +WORKDIR /root + +RUN apt-get update + +# Install gtk headers +RUN apt-get install -y wget libgtk-3-dev libcairo2-dev libglib2.0-dev + +# Install go +RUN wget -O go.tar.gz https://go.dev/dl/go1.17.4.linux-amd64.tar.gz; \ +tar -xf go.tar.gz; + +RUN apt-get install -y git build-essential clang pkg-config zip; + +RUN git clone https://github.com/varnamproject/govarnam.git; \ +git clone https://github.com/varnamproject/govarnam-ibus.git + +ENV PATH="/root/go/bin:${PATH}" + +WORKDIR /root/govarnam + +RUN CC=clang make; \ +sudo make install; \ +make release + +RUN mkdir -p /extract; \ +cp *.zip /extract + +WORKDIR /root/govarnam-ibus + +RUN git checkout gtk-3.10-ubuntu-14.04; \ +make ubuntu-14; \ +make release + +RUN cp *.zip /extract diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..4860b98 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,14 @@ +# Docker + +Builds `govarnam` & `govarnam-ibus` for Ubuntu 14.04 (GTK 3.10, glibc 2.19) & later versions: + +```bash +docker build -t varnam . +``` + +Copy built artifacts from container using: +```bash +id=$(docker create varnam) +docker cp $id:/extract/. ./ +docker rm -v $id +``` \ No newline at end of file diff --git a/go.mod b/go.mod index f02c65f..1c03af9 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,7 @@ go 1.15 require ( github.com/godbus/dbus/v5 v5.0.3 - github.com/gotk3/gotk3 v0.6.0 - github.com/mattn/go-pointer v0.0.1 // indirect + github.com/gotk3/gotk3 v0.6.2-0.20211107090813-1d544513fb74 github.com/varnamproject/govarnam v0.0.0-00010101000000-000000000000 ) diff --git a/go.sum b/go.sum index 68038c6..b81c54b 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gotk3/gotk3 v0.6.0 h1:Aqlq4/6VabNwtCyA9M9zFNad5yHAqCi5heWnZ9y+3dA= -github.com/gotk3/gotk3 v0.6.0/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q= -github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= +github.com/gotk3/gotk3 v0.6.2-0.20211107090813-1d544513fb74 h1:3ZID57DpPn1xRXRzXYl5Sm4OQ4LJG4IFlGo+1TT6xWQ= +github.com/gotk3/gotk3 v0.6.2-0.20211107090813-1d544513fb74/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= diff --git a/preferences.go b/preferences.go index 55361c6..0cda9c1 100644 --- a/preferences.go +++ b/preferences.go @@ -130,8 +130,11 @@ func makeSettingsPage() *gtk.Box { settingsPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) checkError(err) - settingsPage.SetMarginStart(12) - settingsPage.SetMarginEnd(12) + // gtk_widget_set_margin_left & right is deprecated since 3.12 + // It got removed in 3.98: https://github.com/GNOME/gtk/blob/main/NEWS.pre-4.0#L939 + // Our minimum GTK support needed is 3.10 (Ubuntu 14.04) + settingsPage.SetMarginLeft(12) + settingsPage.SetMarginRight(12) settingsPage.SetMarginBottom(12) /* Dictionary Match Exact Preference */ @@ -326,8 +329,8 @@ func makeRLWPage() *gtk.Box { rlwPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) checkError(err) - rlwPage.SetMarginStart(12) - rlwPage.SetMarginEnd(12) + rlwPage.SetMarginLeft(12) + rlwPage.SetMarginRight(12) rlwPage.SetMarginTop(12) rlwPage.SetMarginBottom(12) @@ -406,9 +409,6 @@ func showPrefs() { return } - mainWin.SetDefaultSize(640, 480) - mainWin.SetResizable(false) - mainWin.SetPosition(gtk.WIN_POS_CENTER) mainWin.SetTitle("Varnam " + varnam.GetSchemeDetails().DisplayName + " Preferences (" + engineName + ")") mainWin.Connect("destroy", func() { gtk.MainQuit() @@ -419,8 +419,8 @@ func showPrefs() { notebook.SetScrollable(true) - notebook.SetMarginStart(12) - notebook.SetMarginEnd(12) + notebook.SetMarginLeft(12) + notebook.SetMarginRight(12) notebook.SetMarginBottom(12) settingsLabel, err := gtk.LabelNew("Settings") @@ -433,12 +433,9 @@ func showPrefs() { win.Add(notebook) - settingsPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) - checkError(err) - - settingsPage.SetMarginStart(12) - settingsPage.SetMarginEnd(12) - settingsPage.SetMarginBottom(12) + mainWin.SetSizeRequest(640, 480) + mainWin.SetResizable(true) + mainWin.SetPosition(gtk.WIN_POS_CENTER) // Recursively show all widgets contained in this window. mainWin.ShowAll()