transformers-ocr #1

Open
opened 2024-04-15 02:06:58 +00:00 by hashirama · 1 comment
Owner

transformers-ocr is a wrapper around manga-ocr, which we tried to packaged at that commit:
17706bde8c
this is a work in progress, the code was not functioning , that's why we got rid of it for a while.
But we plain to package that bloat until we come up with a lightweight solution (create our own ocr).

we also need to freeze that package and its dependencies as soon as we get it done , using that function:

(define-module (suix inferior)
  #:use-module ((guix inferior) #:select (inferior-eval
                                           inferior-for-channels))
  #:use-module ((guix channels) #:select (channel
                                           %default-guix-channel))
  #:export (inferior-from-commit
             package/time-traveler))

(define* (inferior-from-commit commit #:optional (channels '()))
  (inferior-for-channels
      `(,@channels
         ,(channel
           (inherit %default-guix-channel)
             (commit commit)))))
 
(define-syntax package/time-traveler
  (lambda (x)
    "Example Usage:
    (package/time-traveler
      (use-modules (gnu packages bash)
                   (gnu packages autotools)
                   ((guix licenses) #:select (gpl3+)))
      (inferior (inferior-from-commit \"v1.3.0\"))
      (name \"hello\")
      (version \"2.12.1\")
      ...)"
    (syntax-case x ()
      ((_
        (field value ...)
         ...)
        #'(let* ((fields '((field value ...) ...))
                (modules (assq-ref fields 'use-modules))
                (inferior
                  (or ((assq-ref `((field . ,(lambda () value ...)) ...) 'inferior))
                    (error "No inferior provided to package/time-traveler")))
                (package-code (assq-remove! (assq-remove! fields 'use-modules) 'inferior)))
            (apply (@@ (guix inferior) inferior-package)
                   (cons inferior
                         (inferior-eval
                           `(begin
                              (use-modules (gnu packages) ,@modules)
                              (let* ((package (package ,@package-code))
                                     (name (package-name package))
                                     (version (package-version package))
                                     (id (object-address package)))
                                (hashv-set!
                                  %package-table id package)
                                (list name version id)))
                            inferior))))))))

transformers-ocr is a wrapper around manga-ocr, which we tried to packaged at that commit: https://git.ajattix.org/hashirama/ajattix/commit/17706bde8c1c4a7005862f527dfdb4fc64031141 this is a work in progress, the code was not functioning , that's why we got rid of it for a while. But we plain to package that bloat until we come up with a lightweight solution (create our own ocr). we also need to freeze that package and its dependencies as soon as we get it done , using that function: ``` scheme (define-module (suix inferior) #:use-module ((guix inferior) #:select (inferior-eval inferior-for-channels)) #:use-module ((guix channels) #:select (channel %default-guix-channel)) #:export (inferior-from-commit package/time-traveler)) (define* (inferior-from-commit commit #:optional (channels '())) (inferior-for-channels `(,@channels ,(channel (inherit %default-guix-channel) (commit commit))))) (define-syntax package/time-traveler (lambda (x) "Example Usage: (package/time-traveler (use-modules (gnu packages bash) (gnu packages autotools) ((guix licenses) #:select (gpl3+))) (inferior (inferior-from-commit \"v1.3.0\")) (name \"hello\") (version \"2.12.1\") ...)" (syntax-case x () ((_ (field value ...) ...) #'(let* ((fields '((field value ...) ...)) (modules (assq-ref fields 'use-modules)) (inferior (or ((assq-ref `((field . ,(lambda () value ...)) ...) 'inferior)) (error "No inferior provided to package/time-traveler"))) (package-code (assq-remove! (assq-remove! fields 'use-modules) 'inferior))) (apply (@@ (guix inferior) inferior-package) (cons inferior (inferior-eval `(begin (use-modules (gnu packages) ,@modules) (let* ((package (package ,@package-code)) (name (package-name package)) (version (package-version package)) (id (object-address package))) (hashv-set! %package-table id package) (list name version id))) inferior)))))))) ```
Author
Owner
some progress at https://issues.guix.gnu.org/73109
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hashirama/ajattix#1
No description provided.