Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gtk-sharp-mono #28671

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6539d64
Add renode
MementoRC Dec 19, 2024
f4f3d85
(ref) add build files
MementoRC Dec 19, 2024
ccfdab9
Add gtk-sharp
MementoRC Dec 19, 2024
bf25eba
(dev) construct build
MementoRC Dec 19, 2024
7694cab
(dev) construct build
MementoRC Dec 19, 2024
13f88ee
(dev) linux pass
MementoRC Dec 20, 2024
dc955cf
(dev) correct PS1, emove linux restriction
MementoRC Dec 20, 2024
86ad12d
(dev) libtool for win. odd on osx
MementoRC Dec 20, 2024
5c39aa6
(dev) sed for win. odd on osx
MementoRC Dec 20, 2024
a95b665
(dev) will this even build for win? patch for osx
MementoRC Dec 20, 2024
6d93d5c
(dev) .dylib osx. no mono PS1
MementoRC Dec 20, 2024
cbf24ea
(dev) pass osx. guess who's a PIA?
MementoRC Dec 20, 2024
da97386
(dev) guess who's a PIA?
MementoRC Dec 20, 2024
dc30c2f
(dev) guess who's a PIA?
MementoRC Dec 20, 2024
7176bef
(dev) guess who's a PIA?
MementoRC Dec 20, 2024
21d891b
(dev) wut wrong? so arcane that win
MementoRC Dec 20, 2024
5067739
(dev) wut wrong? so arcane that win
MementoRC Dec 20, 2024
0a383c3
(dev) wut wrong? so arcane that win
MementoRC Dec 21, 2024
06d4504
(dev) try bash
MementoRC Dec 21, 2024
94385fe
(dev) sure enough, some progress
MementoRC Dec 21, 2024
566f1e9
(dev) sure enough, some progress
MementoRC Dec 21, 2024
524b402
(dev) sure enough, some progress
MementoRC Dec 21, 2024
e675c2e
(dev) sure enough, some progress
MementoRC Dec 21, 2024
045943e
(dev) sure enough, some progress
MementoRC Dec 21, 2024
617cb52
(dev) sure enough, some progress
MementoRC Dec 21, 2024
73fecf7
(dev) sure enough, some progress
MementoRC Dec 21, 2024
4369896
(dev) sure enough, some progress
MementoRC Dec 21, 2024
8639248
(dev) brute force gtk2?
MementoRC Jan 11, 2025
f562e03
(dev) brute force gtk2?
MementoRC Jan 11, 2025
1f634aa
(dev) brute force gtk2?
MementoRC Jan 11, 2025
6d79eb3
(dev) ignore_run_exports syntax
MementoRC Jan 11, 2025
9374e37
(dev) maintainer gtk2. can't skip arch
MementoRC Jan 11, 2025
05eea48
(dev) syntax
MementoRC Jan 11, 2025
d42797b
(dev) rattler syntax corrections
MementoRC Jan 11, 2025
ecc9eb4
(dev) autoconf/make?
MementoRC Jan 11, 2025
297dd45
(dev) automake! win, .lib missing
MementoRC Jan 11, 2025
f6098f8
(dev) automake! win, .lib missing
MementoRC Jan 11, 2025
2d1225c
(dev) .lib created?
MementoRC Jan 12, 2025
a1b2093
(dev) issue with gtk-sharp conda init. PKG_CONFIG?
MementoRC Jan 12, 2025
81a3caf
(fix) remove local wrapper for pkg-config
MementoRC Jan 12, 2025
76401bc
(dbg) use dotnet
MementoRC Jan 12, 2025
15b1ab3
(fix) use autoreconf/autoupdate?
MementoRC Jan 12, 2025
a875d5a
(fix) skip win, will use dotnet noarch build
MementoRC Jan 13, 2025
cfd428e
(ref) remove gtk2
MementoRC Jan 13, 2025
29631fc
Merge branch 'main' into gtk-sharp
MementoRC Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions recipes/gtk-sharp/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
echo source ${SYS_PREFIX}/etc/profile.d/conda.sh > conda_build.sh
echo conda activate "${PREFIX}" >> conda_build.sh
echo conda activate --stack "${BUILD_PREFIX}" >> conda_build.sh
echo CONDA_PREFIX=${CONDA_PREFIX//\\//} >> conda_build.sh
type "%RECIPE_DIR%\build.sh" >> conda_build.sh

set PREFIX=%PREFIX:\=/%
set BUILD_PREFIX=%BUILD_PREFIX:\=/%
set CONDA_PREFIX=%CONDA_PREFIX:\=/%
set SRC_DIR=%SRC_DIR:\=/%
set RECIPE_DIR=%RECIPE_DIR:\=/%
:: set PYTHON=%PYTHON:\=/%
set MSYSTEM=UCRT64
set MSYS2_PATH_TYPE=inherit
set CHERE_INVOKING=1
set build_platform=win-64
set target_platform=win-64
bash -lc "./conda_build.sh"
74 changes: 74 additions & 0 deletions recipes/gtk-sharp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env bash

set -euxo pipefail

export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${PREFIX}/share/pkgconfig:${BUILD_PREFIX}/lib/pkgconfig"

LIBTOOL=$(which libtool)

if [[ ${target_platform} == win-* ]]; then
host_conda_libs="${PREFIX}/Library/lib"
build_conda_libs="${BUILD_PREFIX}/Library/lib"
paths=(
"${host_conda_libs}/pkgconfig"
"${build_conda_libs}/pkgconfig"
)

# Loop through the paths and update PKG_CONFIG_PATH
for path in "${paths[@]}"; do
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-}${PKG_CONFIG_PATH:+:}${path}"
done
PKG_CONFIG=$(which pkg-config.exe | sed -E 's|^/(\w)|\1:|')
PKG_CONFIG_PATH=$(echo "$PKG_CONFIG_PATH" | sed -E 's|^(\w):|/\1|' | sed -E 's|:(\w):|:/\1|g')

export PKG_CONFIG
export PKG_CONFIG_PATH
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_PATH}"
export PATH="${BUILD_PREFIX}/Library/bin:${PREFIX}/Library/bin${PATH:+:${PATH:-}}"
export CC=x86_64-w64-mingw32-gcc
export AR=x86_64-w64-mingw32-ar
export RANLIB=x86_64-w64-mingw32-ranlib
export STRIP=x86_64-w64-mingw32-strip
export LD=x86_64-w64-mingw32-ld
_prefix=${PREFIX}
# Split off last part of the version string
_pkg_version=$(echo "${PKG_VERSION}" | sed -e 's/\.[^.]\+$//')

# Bootstrap with dotnet configuration
./bootstrap-${_pkg_version} --prefix=${_prefix} --with-dotnet
autoreconf -vif
autoupdate

# Configure specifically for dotnet on Windows
./configure \
--prefix=${_prefix} \
--disable-static \
--enable-dotnet \
--disable-mono
else
_prefix=$(pkg-config --variable=prefix mono)
# Split off last part of the version string
_pkg_version=$(echo "${PKG_VERSION}" | sed -e 's/\.[^.]\+$//')

./bootstrap-${_pkg_version} --prefix=${_prefix} --with-dotnet
autoreconf -vif
autoupdate

# This should find the PREFIX mono (check for cross-compilation)
./configure \
--prefix=${_prefix} \
--disable-static
fi

make
make install

# Rename the .so on osx
if [[ ${target_platform} == osx-* ]]; then
cd $(pkg-config --variable=prefix mono)/lib
for f in *.so; do
if [ -f "$f" ]; then
mv "$f" "${f%.so}.dylib"
fi
done
fi
11 changes: 11 additions & 0 deletions recipes/gtk-sharp/patches/fix-TestRange.cs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/sample/test/TestRange.cs
+++ b/sample/test/TestRange.cs
@@ -35 +35 @@
- ((Range) hscale).UpdatePolicy = UpdateType.Delayed;
+ ((Gtk.Range) hscale).UpdatePolicy = UpdateType.Delayed;
@@ -42 +42 @@
- ((Range) hscrollbar).UpdatePolicy = UpdateType.Continuous;
+ ((Gtk.Range) hscrollbar).UpdatePolicy = UpdateType.Continuous;
@@ -62 +62 @@
- ((Range) vscale).Inverted = true;
+ ((Gtk.Range) vscale).Inverted = true;
5 changes: 5 additions & 0 deletions recipes/gtk-sharp/patches/fix-windowmanager.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- a/gdk/glue/windowmanager.c
+++ b/gdk/glue/windowmanager.c
@@ -35 +35 @@
- list [i] = data [i];
+ list [i] = GINT_TO_POINTER(data [i]);
30 changes: 30 additions & 0 deletions recipes/gtk-sharp/patches/update-configure-setup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- a/bootstrap-generic
+++ b/bootstrap-generic
@@ -22 +22 @@
- -e "s/@ASSEMBLY_VERSION@/$ASSEMBLY_VERSION/" $srcdir/configure.in.in > $srcdir/configure.in
+ -e "s/@ASSEMBLY_VERSION@/$ASSEMBLY_VERSION/" $srcdir/configure.in.in > $srcdir/configure.ac
@@ -51 +51 @@
-(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
@@ -104,2 +104,2 @@
-
-if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+autoupdate
+if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
@@ -123 +123 @@
-if grep "^AC_CONFIG_HEADERS" configure.in >/dev/null; then
+if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
--- a/configure.in.in
+++ b/configure.in.in
@@ -6,0 +6,1 @@
+AC_CONFIG_MACRO_DIRS([m4])
@@ -25,2 +26,2 @@
- CC="gcc -g"
- HOST_CC="gcc"
+ CC="${CC} -g"
+ HOST_CC="${CC}"
--- a/Makefile.am
+++ b/Makefile.am
@@ -13 +13 @@
-configure.in: bootstrap.status configure.in.in
+configure.ac: bootstrap.status configure.in.in
113 changes: 113 additions & 0 deletions recipes/gtk-sharp/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
context:
name: gtk-sharp-mono
version: "2.12.45"

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://github.com/mono/gtk-sharp/archive/refs/tags/${{ version }}.tar.gz
sha256: a4bb3593235ef26e1a38c26760f118126ede2801abc41c674aa4d1eee068d9e0
patches:
- patches/fix-TestRange.cs.patch
- patches/fix-windowmanager.c.patch
- patches/update-configure-setup.patch

build:
skip: win
number: 0

requirements:
build:
- ${{ compiler('c') }}
- ${{ stdlib('c') }}
- autoconf =2.69
- automake
- cairo
- expat
- fontconfig
- liblzma-devel
- libtool
- make
- mono # [build_platform != target_platform]
- pango
- pkg-config
- sed
- zlib
host:
- atk
- glib
- gtk2
- mono
- netifaces
- psutil
- pyyaml
- requests
- robotframework
- xorg-xorgproto
run:
- netifaces
- psutil
- pyyaml
- requests
- robotframework

tests:
- package_contents:
bin:
- gapi2-codegen
- gapi2-fixup
- gapi2-parser
lib:
- libatksharpglue-2
- libgdksharpglue-2
- libglibsharpglue-2
- libgtksharpglue-2
- libpangosharpglue-2
files:
- share/gapi-2.0/atk-api.xml
- share/gapi-2.0/gdk-api.xml
- share/gapi-2.0/glib-api.xml
- share/gapi-2.0/gtk-api.xml
- share/gapi-2.0/pango-api.xml

- lib/pkgconfig/gapi-2.0.pc
- lib/pkgconfig/glib-sharp-2.0.pc
- lib/pkgconfig/gtk-dotnet-2.0.pc
- lib/pkgconfig/gtk-sharp-2.0.pc

# - ${{ "Library/" if win }}lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
- lib/gtk-sharp-2.0/gapi-fixup.exe
- lib/gtk-sharp-2.0/gapi-parser.exe
- lib/gtk-sharp-2.0/gapi2xml.pl
- lib/gtk-sharp-2.0/gapi_codegen.exe
- lib/gtk-sharp-2.0/gapi_pp.pl
- script:
interpreter: python
content: |
import os
from pathlib import Path
root = Path(os.environ["PREFIX"]) / ("Library" if os.name == "nt" else "") / "lib" / "mono" / "gtk-sharp-2.0"
vs = ["2.10", "2.4", "2.6", "2.8"]
ds = ["atk-sharp.dll", "gdk-sharp.dll", "glib-sharp.dll", "gtk-dotnet.dll", "gtk-sharp.dll", "pango-sharp.dll"]
missing_dlls = [f"policy.{v}.{d}" for v in vs for d in ds if not (root / f"policy.{v}.{d}").exists()]
if missing_dlls:
print("\n".join(missing_dlls))
exit(1)

about:
homepage: https://github.com/mono/gtk-sharp
summary: "Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit"
description: |
Gtk# is a Graphical User Interface Toolkit for mono and .Net. The project binds
the gtk+ toolkit and assorted GNOME libraries, enabling fully native graphical
Gnome application development using the Mono and .Net development frameworks.
license: GPL-2.0-only
license_file: COPYING
documentation: http://www.mono-project.com/GtkSharp
repository: https://github.com/mono/gtk-sharp

extra:
recipe-maintainers:
- MementoRC
12 changes: 12 additions & 0 deletions recipes/gtk-sharp/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
m2w64_c_compiler:
- gcc
m2w64_c_compiler_version:
- '13'
m2w64_c_stdlib:
- m2w64-sysroot
m2w64_c_stdlib_version:
- '12'
m2w64_cxx_compiler:
- gxx
m2w64_cxx_compiler_version:
- '13'
Loading