Hi,

csc.exe is a Rosyln compiler binary from Microsoft (even in Mono !).
Xamarin, the developers of mono, were eventually bought by Microsoft.

Microsoft .NET is famously bad at bootstrapping.

I think Roslyn's idea of bootstrapping Roslyn is using a binary Roslyn 
compiler.  *slaps forehead*

The only practical way to get a C# program to work while fully bootstrapped 
nowadays is if it only uses C# 7.3 features (or older, of course).  Those 
features are supported by mono 6.

The current C# version is 14.

We shouldn't ship the "csc" wrapper if we don't ship the "csc.exe" binary from 
Microsoft, of course.

It might improve the situation if the xbuild script didn't think csc is 
available.

I've removed the "csc" script from my local guix now and keepass builds and 
runs now.

(define-public keepass
  (package
    (name "keepass")
    (version "2.57.1")
    (source
     (origin
       (method url-fetch)
       (uri
        (string-append 
         "mirror://sourceforge/keepass/KeePass%202.x/"
         version
         "/KeePass-"
         version
         "-Source.zip"))
       (sha256 (base32 
"11i9h0pbvbmz3a6wkp97qhrc8r4l5a2iwxw6vl0zwcp19ka5gdpp"))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases(modify-phases
                   %standard-phases (delete 'install)
                   (add-after
                       'unpack 'set-libgduplus-path
                     (lambda* (#:key inputs #:allow-other-keys)
                       ;; Required for fontconfig to work during the build.
                       (setenv "LD_LIBRARY_PATH"
                               (string-append
                                (assoc-ref inputs "libgdiplus")
                                "/lib"))
                       (setenv "HOME" "/tmp")))
                   (replace 'unpack
                     (lambda* (#:key source #:allow-other-keys)
                       (mkdir "source")
                       (chdir "source")
                       (invoke "unzip" source)))
                   (replace 'configure
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "KeePass.sln"
                         
(("GlobalSection\\(ExtensibilityGlobals\\).*?EndGlobalSection")
                          "")
                         
(("GlobalSection\\(ExtensibilityGlobals\\).*?EndGlobalSection"
                           all)
                          "")
                         (("Format Version 10\\.0")
                          "Format Version 11.00"))
                       (substitute* "KeePass/KeePass.csproj" 
                         ((" ToolsVersion=\\\"3\\.5\\\"")
                          " ToolsVersion=\"4.0\"")
                         (("<SignAssembly>true</SignAssembly>")
                          "<SignAssembly>false</SignAssembly>")
                         (("[$][(]FrameworkSDKDir[)]bin.sgen[.]exe")
                          "sgen")
                         
(("<TargetFrameworkVersion>v4\\.8</TargetFrameworkVersion>")
                          
"<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>"))
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR.ico"
                        "KeePass/KeePass.ico")
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR.ico"
                        "KeePass/IconsKeePass.ico")
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR_G.ico"
                        "KeePass/IconsKeePass_G.ico")
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR_R.ico"
                        "KeePass/IconsKeePass_R.ico")
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR_Y.ico"
                        "KeePass/IconsKeePass_Y.ico")
                       (substitute*
                           "KeePassLib/KeePassLib.csproj"
                         ((" ToolsVersion=\\\"3\\.5\\\"")
                          " ToolsVersion=\"4.0\"")
                         (("<SignAssembly>true</SignAssembly>")
                          "<SignAssembly>false</SignAssembly>"))
                       (substitute*
                           "Translation/TrlUtil/TrlUtil.csproj"
                         ((" ToolsVersion=\\\"3\\.5\\\"") " 
ToolsVersion=\"4.0\""))
                       (copy-file
                        "Ext/Icons_15_VA/LowResIcons/KeePass_LR.ico"
                        "KeePass/Resources/KeePass.ico")))
                   (delete 'patch-source)
                   (replace
                       'build
                     (lambda* (#:key outputs #:allow-other-keys)
                       (setenv "MONO_REGISTRY_PATH" "/dev/null")
                       (setenv "LANG" "C") (setenv "LC_ALL" "C")
                       (invoke
                        "xbuild"
                        "/target:KeePass"
                        "/property:Configuration=Release"
                        "/property:CscToolExe=mcs"
                        "/verbosity:diagnostic"))))
       #:tests? #f)) ;no tests
    (native-inputs (list unzip icoutils))
    (inputs (list mono-6.12.0 libgdiplus))
    (home-page "https://keepass.info";)
    (synopsis
     "A free, open source, light-weight and easy-to-use password manager")
    (description
     "KeePass is a free, open source, light-weight and easy-to-use password 
manager that helps you manage your passwords in a secure way.  All passwords 
are stored
in an encrypted database, which is locked with a master key or key file.")
    (license license:gpl2)))

Reply via email to