Skip to content

Commit

Permalink
Merge branch 'gtk-3.10-ubuntu-14.04' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
subins2000 committed Jan 9, 2022
2 parents 84b30f6 + 087b9bb commit e4c8916
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 21 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
36 changes: 36 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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
```
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
27 changes: 12 additions & 15 deletions preferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand All @@ -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")
Expand All @@ -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()
Expand Down

0 comments on commit e4c8916

Please sign in to comment.