Skip to content

Commit d4f3316

Browse files
committed
Begin upgrading code, starting with src/refocus.c
refocus.c appeared to be a good starting point for updating refocus since compile stops at this file. Importing several code structures into refocus from in gimp-fix-ca and some from gimp-fourier too. gimp-2.10 complains of several deprecated functions during compile, and compiling still stops with refocus.c, mainly due to preview but will work on the deprecated next. At this point, except for resetting default values, it appears that gimp-refocus-plugin builds and runs okay. Begin shedding gimppreview as it conflicts with GIMP's gimppreview.
1 parent c36d49c commit d4f3316

File tree

7 files changed

+512
-2138
lines changed

7 files changed

+512
-2138
lines changed

.github/workflows/main.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
on: [push,pull_request]
3+
4+
jobs:
5+
linux:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
choiceL: [--disable-silent-rules, --enable-silent-rules, --enable-debug]
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Create configure
13+
run: |
14+
sudo apt-get update -y
15+
sudo apt-get install autoconf automake libtool gcc gimp libgimp2.0-dev
16+
autoreconf -i
17+
automake
18+
- name: Choose configure
19+
run: ./configure --prefix=/usr ${{ matrix.choiceL }}
20+
- name: Make gimp-refocus-plugin
21+
run: make
22+
- name: Test make strip
23+
if: matrix.choiceL == '--disable-silent-rules'
24+
run: make strip
25+
- name: Do a make check
26+
if: matrix.choiceL == '--enable-silent-rules'
27+
run: make check
28+
- name: Test user-level install/uninstall
29+
if: matrix.choiceL == '--disable-silent-rules'
30+
run: |
31+
make install-bin
32+
make uninstall-bin
33+
- name: Test 'make install' GIMP shared plugin
34+
if: matrix.choiceL == '--disable-silent-rules'
35+
run: |
36+
sudo make install
37+
sudo make uninstall
38+
- name: Test make distcheck
39+
if: matrix.choiceL == '--disable-silent-rules'
40+
run: make distcheck
41+
win:
42+
runs-on: windows-latest
43+
strategy:
44+
matrix:
45+
include: [
46+
{msystem: MINGW32, toolchain: mingw-w64-i686, version: x32 },
47+
{msystem: MINGW64, toolchain: mingw-w64-x86_64, version: x64 },
48+
{msystem: UCRT64, toolchain: mingw-w64-ucrt-x86_64, version: x64 },
49+
{msystem: CLANG64, toolchain: mingw-w64-clang-x86_64, version: x64 },
50+
]
51+
name: ${{ matrix.msystem }}
52+
defaults:
53+
run:
54+
shell: msys2 {0}
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: msys2/setup-msys2@v2
58+
with:
59+
msystem: ${{ matrix.msystem }}
60+
update: true
61+
install: autotools base-devel git ${{ matrix.toolchain }}-toolchain ${{ matrix.toolchain }}-gimp
62+
- name: Create configure
63+
run: |
64+
autoreconf -i
65+
automake
66+
- name: run ./configure
67+
run: ./configure
68+
- name: Make gimp-refocus-plugin
69+
run: make
70+
- name: Test user-level install/uninstall
71+
run: |
72+
make install-bin
73+
make uninstall-bin

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Introduction
44
- Documentation
55
- Examples
6+
- Build and Install
67
- News
78
- Links
89
- Author
@@ -41,6 +42,38 @@ and optimal refocussing
4142

4243
![](img/wilber-refocussed.png)
4344

45+
## Build and Install
46+
47+
As there are many files in the src directory, it will be easier to build
48+
Refocus using the autoconf tools. You can use gimptool-2.0 to install or
49+
use make install. To build Refocus from Git master requires 2 preparatory
50+
steps:
51+
52+
First, you need to create the `./configure` script if you do not have it yet
53+
```sh
54+
autoreconf -i (or use 'autoreconf --install --force' for more modern setups)
55+
automake --foreign -Wall
56+
```
57+
58+
Second, you then use the usual steps to compile the Refocus plugin.
59+
Various operating systems and setups will need ./configure options set.
60+
The INSTALLATION file has detailed info for `configure' options.
61+
Example install steps shown below are for Linux:
62+
```sh
63+
./configure --prefix=/usr
64+
make
65+
make check
66+
sudo make install
67+
```
68+
and to uninstall, use `make uninstall`.
69+
70+
If you want to use `gimptool-2.0`, you can select to run either
71+
`make install-bin` for a single local user, or if you have administration
72+
root access, you can run `sudo make install-admin-bin`.
73+
74+
If Gimp is already running in your system, exit and restart Gimp for the
75+
new Refocus plug-in to be detected in menu "Filters > Enhance > Refocus".
76+
4477
## News
4578

4679
- V-0-9-1, 2014 Apr 7 - Additional patches by Ernst Lippe 2004, and added patches by Gentoo, copied from [FreeBSD 2014](https://www.freshports.org/graphics/gimp-refocus-plugin/).

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ fi
168168
AC_SUBST(GIMP_CFLAGS)
169169
AC_SUBST(GIMP_LIBS)
170170
AM_CONDITIONAL([HAVEGIMPTOOL],[test "${GIMPTOOL}"x != x])
171+
# Pass GIMP_LIBDIR to automake for default GIMP plug-ins directory
172+
GIMP_GIMPLIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0`
173+
# Seems that gimp does not follow libdir of the distro, so just replacing prefix
174+
GIMP_PREFIX=`$PKG_CONFIG --variable=exec_prefix gimp-2.0`
175+
GIMP_RELATIVE=${GIMP_GIMPLIBDIR#$GIMP_PREFIX}
176+
GIMP_BINDIR=\${exec_prefix}"$GIMP_RELATIVE"
177+
AC_SUBST(GIMP_BINDIR)
171178

172179
GTK_CFLAGS=
173180
GTK_LIBS=

src/Makefile.am

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
## Process this file with automake to produce Makefile.in
22

3-
AM_CFLAGS = ${CFLAGS} ${GTK_CFLAGS} ${GIMP_CFLAGS} ${LAPACK_INCLUDES}
3+
AM_CFLAGS = ${CFLAGS} ${CPPFLAGS} ${GTK_CFLAGS} ${GIMP_CFLAGS} ${LAPACK_INCLUDES}
4+
5+
AM_CPPFLAGS = -I${builddir} -I${srcdir} ${GIMP_CFLAGS} -I${includedir}
46

57
noinst_HEADERS = bdclosure.h refocus.h matrix.h tilebuf.h conv.h \
6-
fwlapack.h gimppreview.h prevman.h util.h
8+
fwlapack.h prevman.h util.h
79
EXTRA_DIST = dummy-plugin.c
810
nodist_EXTRA_DATA = .dep .lib
911

1012
bin_PROGRAMS = refocus
13+
bindir = $(GIMP_BINDIR)/plug-ins
1114
noinst_PROGRAMS = test-matrix
1215

1316
ldadd_atlas=@LAPACK_LIBS@
1417

15-
refocus_SOURCES = refocus.c conv.c gimppreview.c prevman.c util.c \
18+
refocus_SOURCES = refocus.c conv.c prevman.c util.c \
1619
matrix.c tilebuf.c bdclosure.c fwlapack.c
17-
refocus_LDADD = -lm ${ldadd_atlas} ${@GIMP_LIBS} ${GTK_LIBS}
20+
refocus_LDADD = -lm ${ldadd_atlas} ${LIBS} ${GIMP_LIBS} ${GTK_LIBS}
1821
if HAVE_ATLAS
1922
else
2023
refocus_DEPENDENCIES=@BUNDLED_LAPACK_LIB_DIR@/liblapack.a
2124
endif
2225

2326
test_matrix_SOURCES = matrix.c test-matrix.c fwlapack.c
24-
test_matrix_LDADD = -lm ${ldadd_atlas} ${GLIB_LIBS} ${GTK_LIBS}
27+
test_matrix_LDADD = -lm ${ldadd_atlas} ${LIBS} ${GLIB_LIBS} ${GTK_LIBS}
2528
if HAVE_ATLAS
2629
else
2730
test_matrix_DEPENDENCIES=@BUNDLED_LAPACK_LIB_DIR@/liblapack.a

0 commit comments

Comments
 (0)