File dont-install-example-exe.patch of Package ghc-fsnotify

diff -ub fsnotify-0.4.4.0-old/fsnotify.cabal fsnotify-0.4.4.0-new/fsnotify.cabal
--- fsnotify-0.4.4.0-old/fsnotify.cabal	2025-08-26 01:36:06.000000000 +0200
+++ fsnotify-0.4.4.0-new/fsnotify.cabal	2025-09-01 11:43:01.226384902 +0200
@@ -81,6 +81,7 @@
         hinotify >=0.4.1
 
 executable example
+  buildable: False
   main-is: Main.hs
   other-modules:
       Paths_fsnotify
diff -ub fsnotify-0.4.4.0-old/Setup.hs fsnotify-0.4.4.0-new/Setup.hs
--- fsnotify-0.4.4.0-old/Setup.hs	2025-01-01 00:00:00.000000000 +0000
+++ fsnotify-0.4.4.0-new/Setup.hs	2025-09-01 11:43:01.226384902 +0200
@@ -1,3 +1,28 @@
-import Distribution.Simple
-
-main = defaultMain
+import Distribution.Simple
+import System.Environment (getArgs, withArgs)
+import Data.List (isPrefixOf, dropWhileEnd)
+
+-- Filter out -fobject-determinism from GHC options passed via --ghc-options.
+-- Cabal may pass the option with surrounding quotes (single or double), so
+-- strip such quotes before inspecting and reconstruct the option without
+-- the problematic flag.
+main :: IO ()
+main = do
+  args <- getArgs
+  let args' = map filterGhcOptions args
+  withArgs args' defaultMain
+
+stripQuotes :: String -> String
+stripQuotes = dropWhileEnd (`elem` ['\'', '"']) . dropWhile (`elem` ['\'', '"'])
+
+filterGhcOptions :: String -> String
+filterGhcOptions s
+  | "--ghc-options=" `isPrefixOf` s =
+      let prefix = "--ghc-options="
+          opts = drop (length prefix) s
+          filtered = unwords $ filter (/= "-fobject-determinism") (words opts)
+      in prefix ++ filtered
+  | otherwise =
+      let s2 = stripQuotes s
+      in if "--ghc-options=" `isPrefixOf` s2
+           then let prefix = "--ghc-options="
+                    opts = drop (length prefix) s2
+                    filtered = unwords $ filter (/= "-fobject-determinism") (words opts)
+                 in prefix ++ filtered
+           else s
openSUSE Build Service is sponsored by